]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
treewide: python-scripts: use `is None` for none-equality
authorKonstantin Kharlamov <Hi-Angel@yandex.ru>
Sun, 18 Feb 2024 20:02:34 +0000 (23:02 +0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 23 Feb 2024 11:50:00 +0000 (08:50 -0300)
Testing for `None`-ness with `==` operator is frowned upon and causes
warnings in at least "LGTM" python linter. Fix that.

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
math/gen-tgmath-tests.py
nptl/nptl-printers.py

index 216e4640ef265c7129b9e014d9598b14508df350..d3a7f658990f039cf397c341572b3dbad6dc11f7 100755 (executable)
@@ -414,7 +414,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
         # For narrowing macros, compute narrow_args, the list of
         # argument types for which there is an actual corresponding
@@ -462,7 +462,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
@@ -544,7 +544,7 @@ class Tests(object):
             all_conds.append(can_comb)
             if narrowing:
                 all_conds.append(narrow_cond)
-            any_complex = func == None
+            any_complex = func is None
             for t in this_args:
                 if t.complex:
                     any_complex = True
index 41d1a76c651e94405e3e53b9d18431e8a42674f9..fc9d39d70c7a81486280868ffde451ee7476444b 100644 (file)
@@ -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)