From: Simon Marchi Date: Wed, 29 Oct 2025 17:49:19 +0000 (-0400) Subject: gdb/testsuite: use "is" to check against None X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=57c4af5f32254bcd133d91b894796b85bafe1759;p=thirdparty%2Fbinutils-gdb.git gdb/testsuite: use "is" to check against None Fix flake8 warnings like: gdb/testsuite/gdb.base/pc-not-saved.py:55:18: E711 comparison to None should be 'if cond is None:' Change-Id: Icb8bbe3ea444125c9d7ae63b7c1461045782b4b2 Approved-By: Tom Tromey --- diff --git a/gdb/testsuite/gdb.base/pc-not-saved.py b/gdb/testsuite/gdb.base/pc-not-saved.py index e08f3c452b5..4aa633f7440 100644 --- a/gdb/testsuite/gdb.base/pc-not-saved.py +++ b/gdb/testsuite/gdb.base/pc-not-saved.py @@ -52,10 +52,10 @@ class break_unwinding(Unwinder): return None block = gdb.block_for_pc(pc) - if block == None: + if block is None: return None func = block.function - if func == None: + if func is None: return None if str(func) != "break_bt_here": return None diff --git a/gdb/testsuite/gdb.python/py-disasm.py b/gdb/testsuite/gdb.python/py-disasm.py index 5ebc51f652a..4c44de55a72 100644 --- a/gdb/testsuite/gdb.python/py-disasm.py +++ b/gdb/testsuite/gdb.python/py-disasm.py @@ -64,7 +64,7 @@ class TestDisassembler(Disassembler): def __init__(self): super().__init__("TestDisassembler") self.__info = None - if current_pc == None: + if current_pc is None: raise gdb.GdbError("no current_pc set") def __call__(self, info):