Skip to content

Commit 8bc02bf

Browse files
authored
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 <[email protected]>
1 parent 1ee8238 commit 8bc02bf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

bolt/docs/generate_doc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def parse_bolt_options(output):
4545
cleaned_line = line.strip()
4646

4747
if cleaned_line.casefold() in map(str.casefold, section_headers):
48-
if prev_section != None: # Save last option from prev section
48+
if prev_section is not None: # Save last option from prev section
4949
add_info(sections, current_section, option, description)
5050
option, description = None, []
5151

@@ -76,7 +76,7 @@ def parse_bolt_options(output):
7676
description = [descr]
7777
if option.startswith("--print") or option.startswith("--time"):
7878
current_section = "BOLT printing options:"
79-
elif prev_section != None:
79+
elif prev_section is not None:
8080
current_section = prev_section
8181
continue
8282

bolt/test/perf2bolt/lit.local.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import shutil
22

3-
if shutil.which("perf") != None:
3+
if shutil.which("perf") is not None:
44
config.available_features.add("perf")

0 commit comments

Comments
 (0)