Skip to content

Commit aba0476

Browse files
committed
[lldb] Delete lldbutil.PrintableRegex (NFC)
Use of this class wasn't making use of the original regex string. Note that `re.Pattern` has a `pattern` property to access the original regex.
1 parent b178c2d commit aba0476

File tree

3 files changed

+4
-21
lines changed

3 files changed

+4
-21
lines changed

lldb/packages/Python/lldbsuite/test/lldbutil.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,21 +1578,6 @@ def set_actions_for_signal(
15781578
)
15791579

15801580

1581-
class PrintableRegex(object):
1582-
def __init__(self, text):
1583-
self.regex = re.compile(text)
1584-
self.text = text
1585-
1586-
def match(self, str):
1587-
return self.regex.match(str)
1588-
1589-
def __str__(self):
1590-
return "%s" % (self.text)
1591-
1592-
def __repr__(self):
1593-
return "re.compile(%s) -> %s" % (self.text, self.regex)
1594-
1595-
15961581
def skip_if_callable(test, mycallable, reason):
15971582
if callable(mycallable):
15981583
if mycallable(test):

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Test lldb data formatter subsystem.
33
"""
44

5+
import re
56
import lldb
67
from lldbsuite.test.decorators import *
78
from lldbsuite.test.lldbtest import *
@@ -30,9 +31,7 @@ def test(self):
3031

3132
self.runCmd("run", RUN_SUCCEEDED)
3233

33-
lldbutil.skip_if_library_missing(
34-
self, self.target(), lldbutil.PrintableRegex("libc\+\+")
35-
)
34+
lldbutil.skip_if_library_missing(self, self.target(), re.compile(r"libc\+\+"))
3635

3736
# The stop reason of the thread should be breakpoint.
3837
self.expect(

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55

6+
import re
67
import lldb
78
from lldbsuite.test.decorators import *
89
from lldbsuite.test.lldbtest import *
@@ -24,9 +25,7 @@ def test(self):
2425

2526
self.runCmd("run", RUN_SUCCEEDED)
2627

27-
lldbutil.skip_if_library_missing(
28-
self, self.target(), lldbutil.PrintableRegex("libc\+\+")
29-
)
28+
lldbutil.skip_if_library_missing(self, self.target(), re.compile(r"libc\+\+"))
3029

3130
# The stop reason of the thread should be breakpoint.
3231
self.expect(

0 commit comments

Comments
 (0)