[Lldb-commits] [lldb] [lldb][test] Remove Python <= 3.6 workaround (PR #215262)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Mon Aug 10 05:37:04 PDT 2026
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/215262
re.Pattern was added in 3.7 and our minimum
is now 3.8.
Python 3.6.15:
>>> import re
>>> re.Pattern
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 're' has no attribute 'Pattern'
Python 3.7.17:
>>> import re
>>> re.Pattern
<class 're.Pattern'>
Python 3.8.20:
>>> import re
>>> re.Pattern
<class 're.Pattern'>
(it does not appear in documentation until 3.11)
>From 7982082dece3ca2b250f7d1752ffb205b6d9d764 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at arm.com>
Date: Mon, 10 Aug 2026 12:33:14 +0000
Subject: [PATCH] [lldb][test] Remove Python <= 3.6 workaround
re.Pattern was added in 3.7 and our minimum
is now 3.8.
Python 3.6.15:
>>> import re
>>> re.Pattern
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 're' has no attribute 'Pattern'
Python 3.7.17:
>>> import re
>>> re.Pattern
<class 're.Pattern'>
Python 3.8.20:
>>> import re
>>> re.Pattern
<class 're.Pattern'>
(it does not appear in documentation until 3.11)
---
lldb/packages/Python/lldbsuite/test/decorators.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py
index 6524d73e4a349..eab8c16be47fa 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -104,9 +104,7 @@ def _match_decorator_property(expected, actual):
if isinstance(expected, no_match):
return not _match_decorator_property(expected.item, actual)
- # Python 3.6 doesn't declare a `re.Pattern` type, get the dynamic type.
- pattern_type = type(re.compile(""))
- if isinstance(expected, (pattern_type, str)):
+ if isinstance(expected, (re.Pattern, str)):
return re.search(expected, actual) is not None
if hasattr(expected, "__iter__"):
More information about the lldb-commits
mailing list