[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.
This commit is contained in:
Dave Lee
2024-11-23 16:30:57 -08:00
parent b178c2d63e
commit aba0476f23
3 changed files with 4 additions and 21 deletions

View File

@@ -1578,21 +1578,6 @@ def set_actions_for_signal(
)
class PrintableRegex(object):
def __init__(self, text):
self.regex = re.compile(text)
self.text = text
def match(self, str):
return self.regex.match(str)
def __str__(self):
return "%s" % (self.text)
def __repr__(self):
return "re.compile(%s) -> %s" % (self.text, self.regex)
def skip_if_callable(test, mycallable, reason):
if callable(mycallable):
if mycallable(test):

View File

@@ -2,6 +2,7 @@
Test lldb data formatter subsystem.
"""
import re
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
@@ -30,9 +31,7 @@ class LibCxxAtomicTestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
lldbutil.skip_if_library_missing(
self, self.target(), lldbutil.PrintableRegex("libc\+\+")
)
lldbutil.skip_if_library_missing(self, self.target(), re.compile(r"libc\+\+"))
# The stop reason of the thread should be breakpoint.
self.expect(

View File

@@ -3,6 +3,7 @@ Test lldb data formatter subsystem.
"""
import re
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
@@ -24,9 +25,7 @@ class InitializerListTestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
lldbutil.skip_if_library_missing(
self, self.target(), lldbutil.PrintableRegex("libc\+\+")
)
lldbutil.skip_if_library_missing(self, self.target(), re.compile(r"libc\+\+"))
# The stop reason of the thread should be breakpoint.
self.expect(