From b53c5a597536d40d702b4e05b54f3ce33a3533f2 Mon Sep 17 00:00:00 2001 From: Eisuke Kawashima Date: Sat, 11 May 2024 23:57:11 +0900 Subject: [PATCH] fix(bolt/**.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. --- bolt/docs/generate_doc.py | 4 ++-- bolt/test/perf2bolt/lit.local.cfg | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bolt/docs/generate_doc.py b/bolt/docs/generate_doc.py index d8829daf677b4..763dc00b44ca3 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 05f41ff333b0e..4ee9ad08cc78a 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