Skip to content

Commit

Permalink
fix(compiler-rt/**.py): fix comparison to None
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
e-kwsm committed May 31, 2024
1 parent 435e5c1 commit 132c777
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion compiler-rt/test/asan/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if attr_value == None:
if attr_value is None:
lit_config.fatal(
"No attribute %r in test configuration! You may need to run "
"tests from your build directory or add this attribute "
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/builtins/Unit/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if attr_value == None:
if attr_value is None:
lit_config.fatal(
"No attribute %r in test configuration! You may need to run "
"tests from your build directory or add this attribute "
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/ctx_profile/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if attr_value == None:
if attr_value is None:
lit_config.fatal(
"No attribute %r in test configuration! You may need to run "
"tests from your build directory or add this attribute "
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/lsan/lit.common.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if attr_value == None:
if attr_value is None:
lit_config.fatal(
"No attribute %r in test configuration! You may need to run "
"tests from your build directory or add this attribute "
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/memprof/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if attr_value == None:
if attr_value is None:
lit_config.fatal(
"No attribute %r in test configuration! You may need to run "
"tests from your build directory or add this attribute "
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/profile/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if attr_value == None:
if attr_value is None:
lit_config.fatal(
"No attribute %r in test configuration! You may need to run "
"tests from your build directory or add this attribute "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
elif arg == "-o":
output = args.pop(0)

if output == None:
if output is None:
print("No output file name!")
sys.exit(1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
elif arg == "-o":
output = args.pop(0)

if output == None:
if output is None:
print("No output file name!")
sys.exit(1)

Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/ubsan/lit.common.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if attr_value == None:
if attr_value is None:
lit_config.fatal(
"No attribute %r in test configuration! You may need to run "
"tests from your build directory or add this attribute "
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/ubsan_minimal/lit.common.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if attr_value == None:
if attr_value is None:
lit_config.fatal(
"No attribute %r in test configuration! You may need to run "
"tests from your build directory or add this attribute "
Expand Down

0 comments on commit 132c777

Please sign in to comment.