[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [lldb] [llvm] [mlir] [openmp] [polly] fix(python): fix comparison to None (PR #91857)

via lldb-commits lldb-commits at lists.llvm.org
Sat May 11 08:07:12 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Eisuke Kawashima (e-kwsm)

<details>
<summary>Changes</summary>



---

Patch is 35.05 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/91857.diff


50 Files Affected:

- (modified) clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py (+1-1) 
- (modified) clang/docs/DebuggingCoroutines.rst (+4-4) 
- (modified) clang/tools/include-mapping/gen_std.py (+1-1) 
- (modified) clang/utils/check_cfc/obj_diff.py (+1-1) 
- (modified) clang/utils/module-deps-to-rsp.py (+1-1) 
- (modified) compiler-rt/test/asan/lit.cfg.py (+1-1) 
- (modified) compiler-rt/test/builtins/Unit/lit.cfg.py (+1-1) 
- (modified) compiler-rt/test/ctx_profile/lit.cfg.py (+1-1) 
- (modified) compiler-rt/test/lsan/lit.common.cfg.py (+1-1) 
- (modified) compiler-rt/test/memprof/lit.cfg.py (+1-1) 
- (modified) compiler-rt/test/profile/lit.cfg.py (+1-1) 
- (modified) compiler-rt/test/sanitizer_common/android_commands/android_compile.py (+1-1) 
- (modified) compiler-rt/test/sanitizer_common/ios_commands/iossim_compile.py (+1-1) 
- (modified) compiler-rt/test/ubsan/lit.common.cfg.py (+1-1) 
- (modified) compiler-rt/test/ubsan_minimal/lit.common.cfg.py (+1-1) 
- (modified) cross-project-tests/debuginfo-tests/dexter/dex/command/ParseCommand.py (+1-1) 
- (modified) cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ConditionalController.py (+2-2) 
- (modified) cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ControllerHelpers.py (+1-1) 
- (modified) cross-project-tests/debuginfo-tests/dexter/dex/debugger/Debuggers.py (+1-1) 
- (modified) cross-project-tests/debuginfo-tests/dexter/dex/debugger/visualstudio/VisualStudio.py (+1-1) 
- (modified) cross-project-tests/debuginfo-tests/dexter/dex/tools/test/Tool.py (+1-1) 
- (modified) cross-project-tests/lit.cfg.py (+1-1) 
- (modified) lldb/docs/use/python.rst (+2-2) 
- (modified) lldb/examples/python/armv7_cortex_m_target_defintion.py (+1-1) 
- (modified) lldb/packages/Python/lldbsuite/test/dotest.py (+1-1) 
- (modified) lldb/packages/Python/lldbsuite/test/lldbtest.py (+3-3) 
- (modified) lldb/packages/Python/lldbsuite/test/lldbutil.py (+3-3) 
- (modified) lldb/packages/Python/lldbsuite/test/tools/intelpt/intelpt_testcase.py (+1-1) 
- (modified) lldb/test/API/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py (+1-1) 
- (modified) lldb/test/API/functionalities/step_scripted/TestStepScripted.py (+1-1) 
- (modified) lldb/test/API/functionalities/stop-on-sharedlibrary-load/TestStopOnSharedlibraryEvents.py (+1-1) 
- (modified) lldb/test/API/lua_api/TestLuaAPI.py (+1-1) 
- (modified) lldb/test/API/macosx/thread_suspend/TestInternalThreadSuspension.py (+1-1) 
- (modified) lldb/test/API/python_api/event/TestEvents.py (+1-1) 
- (modified) lldb/test/API/python_api/process/read-mem-cstring/TestReadMemCString.py (+1-1) 
- (modified) lldb/test/API/python_api/type/TestTypeList.py (+1-1) 
- (modified) lldb/test/API/python_api/was_interrupted/interruptible.py (+1-1) 
- (modified) lldb/test/Shell/lit.cfg.py (+1-1) 
- (modified) llvm/utils/indirect_calls.py (+1-1) 
- (modified) llvm/utils/lit/lit/TestRunner.py (+1-1) 
- (modified) llvm/utils/lit/lit/util.py (+1-1) 
- (modified) llvm/utils/schedcover.py (+1-1) 
- (modified) llvm/utils/shuffle_select_fuzz_tester.py (+6-6) 
- (modified) mlir/test/python/ir/affine_expr.py (+1-1) 
- (modified) mlir/test/python/ir/attributes.py (+4-4) 
- (modified) mlir/test/python/ir/builtin_types.py (+4-4) 
- (modified) openmp/libompd/gdb-plugin/ompd/ompd_callbacks.py (+1-1) 
- (modified) polly/lib/External/isl/libisl-gdb.py (+2-2) 
- (modified) polly/lib/External/isl/python/isl.py.top (+2-2) 
- (modified) polly/utils/pyscop/isl.py (+4-4) 


``````````diff
diff --git a/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py b/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py
index 6545a3906fa50..53ecb60dec539 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py
+++ b/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py
@@ -47,7 +47,7 @@ def get_checkers(checkers_td, checkers_rst):
         parent_package_ = package["ParentPackage"]
         hidden = (checker["Hidden"] != 0) or (package["Hidden"] != 0)
 
-        while parent_package_ != None:
+        while parent_package_ is not None:
             parent_package = table_entries[parent_package_["def"]]
             checker_package_prefix = (
                 parent_package["PackageName"] + "." + checker_package_prefix
diff --git a/clang/docs/DebuggingCoroutines.rst b/clang/docs/DebuggingCoroutines.rst
index 53bdd08fdbc02..7f464c1f4f28c 100644
--- a/clang/docs/DebuggingCoroutines.rst
+++ b/clang/docs/DebuggingCoroutines.rst
@@ -513,7 +513,7 @@ So we can use the ``continuation`` field to construct the asynchronous stack:
           self.coro_frame = coro_frame
           self.resume_func = dereference(self.coro_frame.resume_addr)
           self.resume_func_block = gdb.block_for_pc(self.resume_func)
-          if self.resume_func_block == None:
+          if self.resume_func_block is None:
               raise Exception('Not stackless coroutine.')
           self.line_info = gdb.find_pc_line(self.resume_func)
 
@@ -543,8 +543,8 @@ So we can use the ``continuation`` field to construct the asynchronous stack:
           self.function_name = f
 
       def __str__(self, shift = 2):
-          addr = "" if self.address() == None else '%#x' % self.address() + " in "
-          location = "" if self.filename() == None else " at " + self.filename() + ":" + str(self.line())
+          addr = "" if self.address() is None else '%#x' % self.address() + " in "
+          location = "" if self.filename() is None else " at " + self.filename() + ":" + str(self.line())
           return addr + self.function() + " " + str([str(args) for args in self.frame_args()]) + location
 
   class CoroutineFilter:
@@ -598,7 +598,7 @@ So we can use the ``continuation`` field to construct the asynchronous stack:
 
           addr = int(argv[0], 16)
           block = gdb.block_for_pc(long(cast_addr2long_pointer(addr).dereference()))
-          if block == None:
+          if block is None:
               print "block " + str(addr) + "  is none."
               return
 
diff --git a/clang/tools/include-mapping/gen_std.py b/clang/tools/include-mapping/gen_std.py
index fcd3bd0d843ea..f362227bc6aab 100755
--- a/clang/tools/include-mapping/gen_std.py
+++ b/clang/tools/include-mapping/gen_std.py
@@ -215,7 +215,7 @@ def GetCCompatibilitySymbols(symbol):
     # Introduce two more entries, both in the global namespace, one using the
     # C++-compat header and another using the C header.
     results = []
-    if symbol.namespace != None:
+    if symbol.namespace is not None:
         # avoid printing duplicated entries, for C macros!
         results.append(cppreference_parser.Symbol(symbol.name, None, [header]))
     c_header = "<" + header[2:-1] + ".h>"  # <cstdio> => <stdio.h>
diff --git a/clang/utils/check_cfc/obj_diff.py b/clang/utils/check_cfc/obj_diff.py
index 99ed19e522be2..9d602593a4e1a 100755
--- a/clang/utils/check_cfc/obj_diff.py
+++ b/clang/utils/check_cfc/obj_diff.py
@@ -57,7 +57,7 @@ def first_diff(a, b, fromfile, tofile):
             first_diff_idx = idx
             break
 
-    if first_diff_idx == None:
+    if first_diff_idx is None:
         # No difference
         return None
 
diff --git a/clang/utils/module-deps-to-rsp.py b/clang/utils/module-deps-to-rsp.py
index 6c9f263a786ef..b57a44e5c8780 100755
--- a/clang/utils/module-deps-to-rsp.py
+++ b/clang/utils/module-deps-to-rsp.py
@@ -74,7 +74,7 @@ def main():
 
         if args.module_name:
             cmd = findModule(args.module_name, full_deps)["command-line"]
-        elif args.tu_index != None:
+        elif args.tu_index is not None:
             tu = full_deps.translation_units[args.tu_index]
             cmd = tu["commands"][args.tu_cmd_index]["command-line"]
 
diff --git a/compiler-rt/test/asan/lit.cfg.py b/compiler-rt/test/asan/lit.cfg.py
index 83b3cbe789cac..7491568e55808 100644
--- a/compiler-rt/test/asan/lit.cfg.py
+++ b/compiler-rt/test/asan/lit.cfg.py
@@ -10,7 +10,7 @@
 
 def get_required_attr(config, attr_name):
     attr_value = getattr(config, attr_name, None)
-    if attr_value == None:
+    if attr_value is None:
         lit_config.fatal(
             "No attribute %r in test configuration! You may need to run "
             "tests from your build directory or add this attribute "
diff --git a/compiler-rt/test/builtins/Unit/lit.cfg.py b/compiler-rt/test/builtins/Unit/lit.cfg.py
index f63d15919888e..c18c973d54c13 100644
--- a/compiler-rt/test/builtins/Unit/lit.cfg.py
+++ b/compiler-rt/test/builtins/Unit/lit.cfg.py
@@ -21,7 +21,7 @@
 
 def get_required_attr(config, attr_name):
     attr_value = getattr(config, attr_name, None)
-    if attr_value == None:
+    if attr_value is None:
         lit_config.fatal(
             "No attribute %r in test configuration! You may need to run "
             "tests from your build directory or add this attribute "
diff --git a/compiler-rt/test/ctx_profile/lit.cfg.py b/compiler-rt/test/ctx_profile/lit.cfg.py
index a56dabb8ebeb3..1bcfc6485ef8e 100644
--- a/compiler-rt/test/ctx_profile/lit.cfg.py
+++ b/compiler-rt/test/ctx_profile/lit.cfg.py
@@ -13,7 +13,7 @@
 
 def get_required_attr(config, attr_name):
     attr_value = getattr(config, attr_name, None)
-    if attr_value == None:
+    if attr_value is None:
         lit_config.fatal(
             "No attribute %r in test configuration! You may need to run "
             "tests from your build directory or add this attribute "
diff --git a/compiler-rt/test/lsan/lit.common.cfg.py b/compiler-rt/test/lsan/lit.common.cfg.py
index e9b974955730d..9426b7d108bbf 100644
--- a/compiler-rt/test/lsan/lit.common.cfg.py
+++ b/compiler-rt/test/lsan/lit.common.cfg.py
@@ -10,7 +10,7 @@
 
 def get_required_attr(config, attr_name):
     attr_value = getattr(config, attr_name, None)
-    if attr_value == None:
+    if attr_value is None:
         lit_config.fatal(
             "No attribute %r in test configuration! You may need to run "
             "tests from your build directory or add this attribute "
diff --git a/compiler-rt/test/memprof/lit.cfg.py b/compiler-rt/test/memprof/lit.cfg.py
index 4e5d7ba405a20..4057da0c65b51 100644
--- a/compiler-rt/test/memprof/lit.cfg.py
+++ b/compiler-rt/test/memprof/lit.cfg.py
@@ -9,7 +9,7 @@
 
 def get_required_attr(config, attr_name):
     attr_value = getattr(config, attr_name, None)
-    if attr_value == None:
+    if attr_value is None:
         lit_config.fatal(
             "No attribute %r in test configuration! You may need to run "
             "tests from your build directory or add this attribute "
diff --git a/compiler-rt/test/profile/lit.cfg.py b/compiler-rt/test/profile/lit.cfg.py
index d3ba115731c5d..191947e4f64aa 100644
--- a/compiler-rt/test/profile/lit.cfg.py
+++ b/compiler-rt/test/profile/lit.cfg.py
@@ -6,7 +6,7 @@
 
 def get_required_attr(config, attr_name):
     attr_value = getattr(config, attr_name, None)
-    if attr_value == None:
+    if attr_value is None:
         lit_config.fatal(
             "No attribute %r in test configuration! You may need to run "
             "tests from your build directory or add this attribute "
diff --git a/compiler-rt/test/sanitizer_common/android_commands/android_compile.py b/compiler-rt/test/sanitizer_common/android_commands/android_compile.py
index f86831ffef899..e9c6738a09a3f 100755
--- a/compiler-rt/test/sanitizer_common/android_commands/android_compile.py
+++ b/compiler-rt/test/sanitizer_common/android_commands/android_compile.py
@@ -20,7 +20,7 @@
     elif arg == "-o":
         output = args.pop(0)
 
-if output == None:
+if output is None:
     print("No output file name!")
     sys.exit(1)
 
diff --git a/compiler-rt/test/sanitizer_common/ios_commands/iossim_compile.py b/compiler-rt/test/sanitizer_common/ios_commands/iossim_compile.py
index 39b211b093c92..2eac1a9bab455 100755
--- a/compiler-rt/test/sanitizer_common/ios_commands/iossim_compile.py
+++ b/compiler-rt/test/sanitizer_common/ios_commands/iossim_compile.py
@@ -19,7 +19,7 @@
     elif arg == "-o":
         output = args.pop(0)
 
-if output == None:
+if output is None:
     print("No output file name!")
     sys.exit(1)
 
diff --git a/compiler-rt/test/ubsan/lit.common.cfg.py b/compiler-rt/test/ubsan/lit.common.cfg.py
index 61f6818cce064..04d6f24de5a9f 100644
--- a/compiler-rt/test/ubsan/lit.common.cfg.py
+++ b/compiler-rt/test/ubsan/lit.common.cfg.py
@@ -5,7 +5,7 @@
 
 def get_required_attr(config, attr_name):
     attr_value = getattr(config, attr_name, None)
-    if attr_value == None:
+    if attr_value is None:
         lit_config.fatal(
             "No attribute %r in test configuration! You may need to run "
             "tests from your build directory or add this attribute "
diff --git a/compiler-rt/test/ubsan_minimal/lit.common.cfg.py b/compiler-rt/test/ubsan_minimal/lit.common.cfg.py
index d398d3a0a8162..e60aed6512fb9 100644
--- a/compiler-rt/test/ubsan_minimal/lit.common.cfg.py
+++ b/compiler-rt/test/ubsan_minimal/lit.common.cfg.py
@@ -5,7 +5,7 @@
 
 def get_required_attr(config, attr_name):
     attr_value = getattr(config, attr_name, None)
-    if attr_value == None:
+    if attr_value is None:
         lit_config.fatal(
             "No attribute %r in test configuration! You may need to run "
             "tests from your build directory or add this attribute "
diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/command/ParseCommand.py b/cross-project-tests/debuginfo-tests/dexter/dex/command/ParseCommand.py
index 29d7867e80867..4b086e14d4050 100644
--- a/cross-project-tests/debuginfo-tests/dexter/dex/command/ParseCommand.py
+++ b/cross-project-tests/debuginfo-tests/dexter/dex/command/ParseCommand.py
@@ -98,7 +98,7 @@ def _build_command(
 
     def label_to_line(label_name: str) -> int:
         line = labels.get(label_name, None)
-        if line != None:
+        if line is not None:
             return line
         raise format_unresolved_label_err(label_name, raw_text, path.base, lineno)
 
diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ConditionalController.py b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ConditionalController.py
index a7d6b570b55e8..ac3054c3a0edf 100644
--- a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ConditionalController.py
+++ b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ConditionalController.py
@@ -62,7 +62,7 @@ def __init__(
         self.finish_on_remove = finish_on_remove
 
     def has_conditions(self):
-        return self.expression != None
+        return self.expression is not None
 
     def get_conditional_expression_list(self):
         conditional_list = []
@@ -76,7 +76,7 @@ def add_hit(self):
         self.current_hit_count += 1
 
     def should_be_removed(self):
-        if self.max_hit_count == None:
+        if self.max_hit_count is None:
             return False
         return self.current_hit_count >= self.max_hit_count
 
diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ControllerHelpers.py b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ControllerHelpers.py
index 3e5a7b919d703..a4ca5ae0158e9 100644
--- a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ControllerHelpers.py
+++ b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ControllerHelpers.py
@@ -39,7 +39,7 @@ def update_step_watches(step_info, watches, commands):
         for watch in towatch:
             loc = step_info.current_location
             if (
-                loc.path != None
+                loc.path is not None
                 and os.path.exists(loc.path)
                 and os.path.samefile(watch.path, loc.path)
                 and have_hit_line(watch, loc)
diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/Debuggers.py b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/Debuggers.py
index 1b0d4d5871cbe..67b715af78698 100644
--- a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/Debuggers.py
+++ b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/Debuggers.py
@@ -183,7 +183,7 @@ def handle_debugger_tool_options(context, defaults):  # noqa
         if options.debugger == "lldb":
             _warn_meaningless_option(context, "--show-debugger")
 
-    if options.source_root_dir != None:
+    if options.source_root_dir is not None:
         if not os.path.isabs(options.source_root_dir):
             raise ToolArgumentError(
                 f'<d>--source-root-dir: expected absolute path, got</> <r>"{options.source_root_dir}"</>'
diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/visualstudio/VisualStudio.py b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/visualstudio/VisualStudio.py
index 0e20cfbbd264b..f87e1312819e2 100644
--- a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/visualstudio/VisualStudio.py
+++ b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/visualstudio/VisualStudio.py
@@ -235,7 +235,7 @@ def delete_breakpoints(self, ids):
         for bp in self._debugger.Breakpoints:
             # We're looking at the user-set breakpoints so there should be no
             # Parent.
-            assert bp.Parent == None
+            assert bp.Parent is None
             this_vsbp = VSBreakpoint(
                 PurePath(bp.File), bp.FileLine, bp.FileColumn, bp.Condition
             )
diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/tools/test/Tool.py b/cross-project-tests/debuginfo-tests/dexter/dex/tools/test/Tool.py
index f07641041254b..c366062cec7a9 100644
--- a/cross-project-tests/debuginfo-tests/dexter/dex/tools/test/Tool.py
+++ b/cross-project-tests/debuginfo-tests/dexter/dex/tools/test/Tool.py
@@ -150,7 +150,7 @@ def _get_results_path(self, test_name):
         """Returns the path to the test results directory for the test denoted
         by test_name.
         """
-        assert self.context.options.results_directory != None
+        assert self.context.options.results_directory is not None
         return os.path.join(
             self.context.options.results_directory,
             self._get_results_basename(test_name),
diff --git a/cross-project-tests/lit.cfg.py b/cross-project-tests/lit.cfg.py
index 774c4eaf4d976..6341d5c300d86 100644
--- a/cross-project-tests/lit.cfg.py
+++ b/cross-project-tests/lit.cfg.py
@@ -54,7 +54,7 @@
 
 def get_required_attr(config, attr_name):
     attr_value = getattr(config, attr_name, None)
-    if attr_value == None:
+    if attr_value is None:
         lit_config.fatal(
             "No attribute %r in test configuration! You may need to run "
             "tests from your build directory or add this attribute "
diff --git a/lldb/docs/use/python.rst b/lldb/docs/use/python.rst
index 6183d6935d80e..d9c29d95708c1 100644
--- a/lldb/docs/use/python.rst
+++ b/lldb/docs/use/python.rst
@@ -75,13 +75,13 @@ later explanations:
    12:     if root_word == word:
    13:         return cur_path
    14:     elif word < root_word:
-   15:         if left_child_ptr.GetValue() == None:
+   15:         if left_child_ptr.GetValue() is None:
    16:             return ""
    17:         else:
    18:             cur_path = cur_path + "L"
    19:             return DFS (left_child_ptr, word, cur_path)
    20:     else:
-   21:         if right_child_ptr.GetValue() == None:
+   21:         if right_child_ptr.GetValue() is None:
    22:             return ""
    23:         else:
    24:             cur_path = cur_path + "R"
diff --git a/lldb/examples/python/armv7_cortex_m_target_defintion.py b/lldb/examples/python/armv7_cortex_m_target_defintion.py
index 42eaa39993dae..8225670f33e6b 100755
--- a/lldb/examples/python/armv7_cortex_m_target_defintion.py
+++ b/lldb/examples/python/armv7_cortex_m_target_defintion.py
@@ -222,7 +222,7 @@ def get_reg_num(reg_num_dict, reg_name):
 
 def get_target_definition():
     global g_target_definition
-    if g_target_definition == None:
+    if g_target_definition is None:
         g_target_definition = {}
         offset = 0
         for reg_info in armv7_register_infos:
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index ebabf348643ef..d6757f000c14d 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -47,7 +47,7 @@
 
 def is_exe(fpath):
     """Returns true if fpath is an executable."""
-    if fpath == None:
+    if fpath is None:
         return False
     if sys.platform == "win32":
         if not fpath.endswith(".exe"):
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 5fd686c143e9f..cb3ae0e422975 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -229,7 +229,7 @@ def pointer_size():
 
 def is_exe(fpath):
     """Returns true if fpath is an executable."""
-    if fpath == None:
+    if fpath is None:
         return False
     if sys.platform == "win32":
         if not fpath.endswith(".exe"):
@@ -2191,7 +2191,7 @@ def complete_from_to(self, str_input, patterns):
         if num_matches == 0:
             compare_string = str_input
         else:
-            if common_match != None and len(common_match) > 0:
+            if common_match is not None and len(common_match) > 0:
                 compare_string = str_input + common_match
             else:
                 compare_string = ""
@@ -2552,7 +2552,7 @@ def assertFailure(self, obj, error_str=None, msg=None):
         if obj.Success():
             self.fail(self._formatMessage(msg, "Error not in a fail state"))
 
-        if error_str == None:
+        if error_str is None:
             return
 
         error = obj.GetCString()
diff --git a/lldb/packages/Python/lldbsuite/test/lldbutil.py b/lldb/packages/Python/lldbsuite/test/lldbutil.py
index 58eb37fd742d7..629d8ce494b85 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -1594,11 +1594,11 @@ def set_actions_for_signal(
 ):
     return_obj = lldb.SBCommandReturnObject()
     command = "process handle {0}".format(signal_name)
-    if pass_action != None:
+    if pass_action is not None:
         command += " -p {0}".format(pass_action)
-    if stop_action != None:
+    if stop_action is not None:
         command += " -s {0}".format(stop_action)
-    if notify_action != None:
+    if notify_action is not None:
         command += " -n {0}".format(notify_action)
 
     testcase.dbg.GetCommandInterpreter().HandleCommand(command, return_obj)
diff --git a/lldb/packages/Python/lldbsuite/test/tools/intelpt/intelpt_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/intelpt/intelpt_testcase.py
index fd1eb64219585..f1b7d7c33bf07 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/intelpt/intelpt_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/intelpt/intelpt_testcase.py
@@ -134,7 +134,7 @@ def traceStartProcess(
             self.assertSBError(trace.Start(configuration), error=error)
         else:
             command = "process trace start"
-            if processBufferSizeLimit != None:
+            if processBufferSizeLimit is not None:
                 command += " -l " + str(processBufferSizeLimit)
             if enableTsc:
                 command += " --tsc"
diff --git a/lldb/test/API/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py b/lldb/test/API/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py
index d120692e4d6e6..3674a8c233c8d 100644
--- a/lldb/test/API/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py
+++ b/lldb/test/API/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py
@@ -32,7 +32,7 @@ def address_breakpoints(self):
 ...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/91857


More information about the lldb-commits mailing list