[v2,3/3] python scripts: don't use "==" to compare to None
Commit Message
Fixes 4 LGTM warnings "Testing for None should use the 'is' operator."
Reviewed-by: Joseph Myers <joseph@codesourcery.com>
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
---
math/gen-tgmath-tests.py | 6 +++---
nptl/nptl-printers.py | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
@@ -385,7 +385,7 @@ class Tests(object):
elif ret == 'g' or 'g' in args:
# Real and complex.
have_complex = True
- if complex_func == None:
+ if complex_func is None:
complex_func = 'c%s' % func
types = [ret] + args
for t in types:
@@ -396,7 +396,7 @@ class Tests(object):
continue
if t.complex and not have_complex:
continue
- if func == None and not t.complex:
+ if func is None and not t.complex:
continue
if ret == 's' and t.name.startswith('_Float'):
continue
@@ -449,7 +449,7 @@ class Tests(object):
can_comb = Type.can_combine_types(this_args)
all_conds = [t.condition for t in this_args]
all_conds.append(can_comb)
- any_complex = func == None
+ any_complex = func is None
for t in this_args:
if t.complex:
any_complex = True
@@ -587,7 +587,7 @@ def register(objfile):
printer.add_printer('pthread_rwlockattr_t', r'^pthread_rwlockattr_t$',
RWLockAttributesPrinter)
- if objfile == None:
+ if objfile is None:
objfile = gdb
gdb.printing.register_pretty_printer(objfile, printer)