summaryrefslogtreecommitdiff
path: root/lldb/examples/python
diff options
context:
space:
mode:
authorEisuke Kawashima <e.kawaschima+github@gmail.com>2024-06-26 23:55:15 +0900
committerGitHub <noreply@github.com>2024-06-26 15:55:15 +0100
commitfd35a92300a00edaf56ae94176317390677569a4 (patch)
tree0141101560a5b1acfd7eafce374ca6bdb1a435a8 /lldb/examples/python
parent019f525716348578802b02961c328b43f7cad0fb (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-xlldb/examples/python/crashlog.py2
-rwxr-xr-xlldb/examples/python/disasm-stress-test.py4
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)