aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEisuke Kawashima <e.kawaschima+github@gmail.com>2024-07-20 08:59:56 +0900
committerGitHub <noreply@github.com>2024-07-19 16:59:56 -0700
commit8bc02bf5c6e94489a79c8d924e5d9866fcc18417 (patch)
tree9e64bc56761f52ead7c2c6039a2f78868d5341b9
parent1ee8238f0eab75386522a002c2cbb6146284c0c1 (diff)
downloadllvm-8bc02bf5c6e94489a79c8d924e5d9866fcc18417.zip
llvm-8bc02bf5c6e94489a79c8d924e5d9866fcc18417.tar.gz
llvm-8bc02bf5c6e94489a79c8d924e5d9866fcc18417.tar.bz2
fix(bolt/**.py): fix comparison to None (#94012)
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. Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
-rw-r--r--bolt/docs/generate_doc.py4
-rw-r--r--bolt/test/perf2bolt/lit.local.cfg2
2 files changed, 3 insertions, 3 deletions
diff --git a/bolt/docs/generate_doc.py b/bolt/docs/generate_doc.py
index d8829da..763dc00 100644
--- a/bolt/docs/generate_doc.py
+++ b/bolt/docs/generate_doc.py
@@ -45,7 +45,7 @@ def parse_bolt_options(output):
cleaned_line = line.strip()
if cleaned_line.casefold() in map(str.casefold, section_headers):
- if prev_section != None: # Save last option from prev section
+ if prev_section is not None: # Save last option from prev section
add_info(sections, current_section, option, description)
option, description = None, []
@@ -76,7 +76,7 @@ def parse_bolt_options(output):
description = [descr]
if option.startswith("--print") or option.startswith("--time"):
current_section = "BOLT printing options:"
- elif prev_section != None:
+ elif prev_section is not None:
current_section = prev_section
continue
diff --git a/bolt/test/perf2bolt/lit.local.cfg b/bolt/test/perf2bolt/lit.local.cfg
index 05f41ff..4ee9ad0 100644
--- a/bolt/test/perf2bolt/lit.local.cfg
+++ b/bolt/test/perf2bolt/lit.local.cfg
@@ -1,4 +1,4 @@
import shutil
-if shutil.which("perf") != None:
+if shutil.which("perf") is not None:
config.available_features.add("perf") \ No newline at end of file