Skip to content

Commit 132c777

Browse files
committed
fix(compiler-rt/**.py): fix comparison to None
from PEP8 (https://peps.python.org/pep-0008/#programming-recommendations): > Comparisons to singletons like None should always be done with is or > is not, never the equality operators.
1 parent 435e5c1 commit 132c777

File tree

10 files changed

+10
-10
lines changed

10 files changed

+10
-10
lines changed

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 "

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

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

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

compiler-rt/test/sanitizer_common/android_commands/android_compile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
elif arg == "-o":
2121
output = args.pop(0)
2222

23-
if output == None:
23+
if output is None:
2424
print("No output file name!")
2525
sys.exit(1)
2626

compiler-rt/test/sanitizer_common/ios_commands/iossim_compile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
elif arg == "-o":
2020
output = args.pop(0)
2121

22-
if output == None:
22+
if output is None:
2323
print("No output file name!")
2424
sys.exit(1)
2525

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

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

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

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

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

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

0 commit comments

Comments
 (0)