Skip to content

Commit c450df1

Browse files
committed
fix(python): fix comparison to None
1 parent 079fdef commit c450df1

File tree

50 files changed

+75
-75
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+75
-75
lines changed

clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def get_checkers(checkers_td, checkers_rst):
4747
parent_package_ = package["ParentPackage"]
4848
hidden = (checker["Hidden"] != 0) or (package["Hidden"] != 0)
4949

50-
while parent_package_ != None:
50+
while parent_package_ is not None:
5151
parent_package = table_entries[parent_package_["def"]]
5252
checker_package_prefix = (
5353
parent_package["PackageName"] + "." + checker_package_prefix

clang/docs/DebuggingCoroutines.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ So we can use the ``continuation`` field to construct the asynchronous stack:
513513
self.coro_frame = coro_frame
514514
self.resume_func = dereference(self.coro_frame.resume_addr)
515515
self.resume_func_block = gdb.block_for_pc(self.resume_func)
516-
if self.resume_func_block == None:
516+
if self.resume_func_block is None:
517517
raise Exception('Not stackless coroutine.')
518518
self.line_info = gdb.find_pc_line(self.resume_func)
519519
@@ -543,8 +543,8 @@ So we can use the ``continuation`` field to construct the asynchronous stack:
543543
self.function_name = f
544544
545545
def __str__(self, shift = 2):
546-
addr = "" if self.address() == None else '%#x' % self.address() + " in "
547-
location = "" if self.filename() == None else " at " + self.filename() + ":" + str(self.line())
546+
addr = "" if self.address() is None else '%#x' % self.address() + " in "
547+
location = "" if self.filename() is None else " at " + self.filename() + ":" + str(self.line())
548548
return addr + self.function() + " " + str([str(args) for args in self.frame_args()]) + location
549549
550550
class CoroutineFilter:
@@ -598,7 +598,7 @@ So we can use the ``continuation`` field to construct the asynchronous stack:
598598
599599
addr = int(argv[0], 16)
600600
block = gdb.block_for_pc(long(cast_addr2long_pointer(addr).dereference()))
601-
if block == None:
601+
if block is None:
602602
print "block " + str(addr) + " is none."
603603
return
604604

clang/tools/include-mapping/gen_std.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def GetCCompatibilitySymbols(symbol):
215215
# Introduce two more entries, both in the global namespace, one using the
216216
# C++-compat header and another using the C header.
217217
results = []
218-
if symbol.namespace != None:
218+
if symbol.namespace is not None:
219219
# avoid printing duplicated entries, for C macros!
220220
results.append(cppreference_parser.Symbol(symbol.name, None, [header]))
221221
c_header = "<" + header[2:-1] + ".h>" # <cstdio> => <stdio.h>

clang/utils/check_cfc/obj_diff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def first_diff(a, b, fromfile, tofile):
5757
first_diff_idx = idx
5858
break
5959

60-
if first_diff_idx == None:
60+
if first_diff_idx is None:
6161
# No difference
6262
return None
6363

clang/utils/module-deps-to-rsp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def main():
7474

7575
if args.module_name:
7676
cmd = findModule(args.module_name, full_deps)["command-line"]
77-
elif args.tu_index != None:
77+
elif args.tu_index is not None:
7878
tu = full_deps.translation_units[args.tu_index]
7979
cmd = tu["commands"][args.tu_cmd_index]["command-line"]
8080

compiler-rt/test/asan/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def get_required_attr(config, attr_name):
1212
attr_value = getattr(config, attr_name, None)
13-
if attr_value == None:
13+
if attr_value is None:
1414
lit_config.fatal(
1515
"No attribute %r in test configuration! You may need to run "
1616
"tests from your build directory or add this attribute "

compiler-rt/test/builtins/Unit/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
def get_required_attr(config, attr_name):
2323
attr_value = getattr(config, attr_name, None)
24-
if attr_value == None:
24+
if attr_value is None:
2525
lit_config.fatal(
2626
"No attribute %r in test configuration! You may need to run "
2727
"tests from your build directory or add this attribute "

compiler-rt/test/ctx_profile/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
def get_required_attr(config, attr_name):
1515
attr_value = getattr(config, attr_name, None)
16-
if attr_value == None:
16+
if attr_value is None:
1717
lit_config.fatal(
1818
"No attribute %r in test configuration! You may need to run "
1919
"tests from your build directory or add this attribute "

compiler-rt/test/lsan/lit.common.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def get_required_attr(config, attr_name):
1212
attr_value = getattr(config, attr_name, None)
13-
if attr_value == None:
13+
if attr_value is None:
1414
lit_config.fatal(
1515
"No attribute %r in test configuration! You may need to run "
1616
"tests from your build directory or add this attribute "

compiler-rt/test/memprof/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
def get_required_attr(config, attr_name):
1111
attr_value = getattr(config, attr_name, None)
12-
if attr_value == None:
12+
if attr_value is None:
1313
lit_config.fatal(
1414
"No attribute %r in test configuration! You may need to run "
1515
"tests from your build directory or add this attribute "

0 commit comments

Comments
 (0)