From ba7d1b80d051f8004fa6a294e8331dcb33b85f6d Mon Sep 17 00:00:00 2001 From: Guanqun Lu Date: Fri, 6 Sep 2019 15:14:25 +0800 Subject: [PATCH] it's more pythonic to use 'is not None' in python files --- src/bootstrap/bootstrap.py | 2 +- src/libcore/unicode/printable.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 4162fe1df5086..179cd488be732 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -668,7 +668,7 @@ def check_submodule(self, module, slow_submodules): def update_submodule(self, module, checked_out, recorded_submodules): module_path = os.path.join(self.rust_root, module) - if checked_out != None: + if checked_out is not None: default_encoding = sys.getdefaultencoding() checked_out = checked_out.communicate()[0].decode(default_encoding).strip() if recorded_submodules[module] == checked_out: diff --git a/src/libcore/unicode/printable.py b/src/libcore/unicode/printable.py index 748917f1d3420..4e8b4ecad0200 100644 --- a/src/libcore/unicode/printable.py +++ b/src/libcore/unicode/printable.py @@ -60,7 +60,7 @@ def get_codepoints(f): yield Codepoint(codepoint, class_) prev_codepoint = codepoint - if class_first != None: + if class_first is not None: raise ValueError("Missing Last after First") for c in range(prev_codepoint + 1, NUM_CODEPOINTS):