[Lldb-commits] [lldb] [lldb] Add support for NoneType to decorator skipIfBuildType (PR #145342)
Ivan Tadeu Ferreira Antunes Filho via lldb-commits
lldb-commits at lists.llvm.org
Mon Jun 23 08:56:33 PDT 2025
https://github.com/itf updated https://github.com/llvm/llvm-project/pull/145342
>From a79352fe1eac306b6065b1cba165b176ddc1376f Mon Sep 17 00:00:00 2001
From: Ivan Tadeu Ferreira Antunes Filho <antunesi at google.com>
Date: Mon, 23 Jun 2025 11:30:09 -0400
Subject: [PATCH 1/3] [lldb] Add support to NoneType to decorator
skipIfBuildType
Currently if cmake_build_type is None we error with `AttributeError: 'NoneType' object has no attribute 'lower'` if the decorator skipIfBuildType is used. This fixes the issue by first checking that cmake_build_type is not None.
---
lldb/packages/Python/lldbsuite/test/decorators.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py
index a391319ca9b0e..d74979891f548 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -1155,6 +1155,7 @@ def skipIfBuildType(types: list[str]):
"""
types = [name.lower() for name in types]
return unittest.skipIf(
+ configuration.cmake_build_type != None &&
configuration.cmake_build_type.lower() in types,
"skip on {} build type(s)".format(", ".join(types)),
)
>From 28edf2d8d5ee42f5655a9be5b759c73152e8c7b5 Mon Sep 17 00:00:00 2001
From: Ivan Tadeu Ferreira Antunes Filho <antunesi at google.com>
Date: Mon, 23 Jun 2025 11:41:20 -0400
Subject: [PATCH 2/3] Correct the syntax
---
lldb/packages/Python/lldbsuite/test/decorators.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py
index d74979891f548..34eec40e4b4a7 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -1155,7 +1155,7 @@ def skipIfBuildType(types: list[str]):
"""
types = [name.lower() for name in types]
return unittest.skipIf(
- configuration.cmake_build_type != None &&
+ configuration.cmake_build_type is not None and
configuration.cmake_build_type.lower() in types,
"skip on {} build type(s)".format(", ".join(types)),
)
>From 1484e082ef15def500119bba198a5b4ac0c4af1b Mon Sep 17 00:00:00 2001
From: Ivan Tadeu Ferreira Antunes Filho <antunesi at google.com>
Date: Mon, 23 Jun 2025 11:56:24 -0400
Subject: [PATCH 3/3] Fix formatting
---
lldb/packages/Python/lldbsuite/test/decorators.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py
index 34eec40e4b4a7..a5f58373ede75 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -1155,7 +1155,7 @@ def skipIfBuildType(types: list[str]):
"""
types = [name.lower() for name in types]
return unittest.skipIf(
- configuration.cmake_build_type is not None and
- configuration.cmake_build_type.lower() in types,
+ configuration.cmake_build_type is not None
+ and configuration.cmake_build_type.lower() in types,
"skip on {} build type(s)".format(", ".join(types)),
)
More information about the lldb-commits
mailing list