diff options
| author | Eisuke Kawashima <e.kawaschima+github@gmail.com> | 2024-06-26 23:55:15 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-26 15:55:15 +0100 |
| commit | fd35a92300a00edaf56ae94176317390677569a4 (patch) | |
| tree | 0141101560a5b1acfd7eafce374ca6bdb1a435a8 /lldb/examples/python | |
| parent | 019f525716348578802b02961c328b43f7cad0fb (diff) | |
[lldb] fix(lldb/**.py): fix comparison to True/False (#94039)
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>
Diffstat (limited to 'lldb/examples/python')
| -rwxr-xr-x | lldb/examples/python/crashlog.py | 2 | ||||
| -rwxr-xr-x | lldb/examples/python/disasm-stress-test.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py index 1c0d717ce455..368437ed63e4 100755 --- a/lldb/examples/python/crashlog.py +++ b/lldb/examples/python/crashlog.py @@ -166,7 +166,7 @@ class CrashLog(symbolication.Symbolicator): this_thread_crashed = self.app_specific_backtrace if not this_thread_crashed: this_thread_crashed = self.did_crash() - if options.crashed_only and this_thread_crashed == False: + if options.crashed_only and not this_thread_crashed: return print("%s" % self) diff --git a/lldb/examples/python/disasm-stress-test.py b/lldb/examples/python/disasm-stress-test.py index 2d3314ee8e8f..62b2b90a2860 100755 --- a/lldb/examples/python/disasm-stress-test.py +++ b/lldb/examples/python/disasm-stress-test.py @@ -95,13 +95,13 @@ import lldb debugger = lldb.SBDebugger.Create() -if debugger.IsValid() == False: +if not debugger.IsValid(): print("Couldn't create an SBDebugger") sys.exit(-1) target = debugger.CreateTargetWithFileAndArch(None, arg_ns.arch) -if target.IsValid() == False: +if not target.IsValid(): print("Couldn't create an SBTarget for architecture " + arg_ns.arch) sys.exit(-1) |
