diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py index 14798592a1873..741d60d91921c 100755 --- a/lldb/examples/python/crashlog.py +++ b/lldb/examples/python/crashlog.py @@ -296,7 +296,7 @@ class DarwinImage(symbolication.Image): except: dsymForUUIDBinary = "" - dwarfdump_uuid_regex = re.compile("UUID: ([-0-9a-fA-F]+) \(([^\(]+)\) .*") + dwarfdump_uuid_regex = re.compile(r"UUID: ([-0-9a-fA-F]+) \(([^\(]+)\) .*") def __init__( self, text_addr_lo, text_addr_hi, identifier, version, uuid, path, verbose @@ -501,7 +501,7 @@ def find_image_with_identifier(self, identifier): for image in self.images: if image.identifier == identifier: return image - regex_text = "^.*\.%s$" % (re.escape(identifier)) + regex_text = r"^.*\.%s$" % (re.escape(identifier)) regex = re.compile(regex_text) for image in self.images: if regex.match(image.identifier): @@ -925,7 +925,7 @@ def get(cls): version = r"(?:" + super().version + r"\s+)?" address = r"(0x[0-9a-fA-F]{4,})" # 4 digits or more - symbol = """ + symbol = r""" (?: [ ]+ (?P.+) @@ -1095,7 +1095,7 @@ def parse_normal(self, line): self.crashlog.process_identifier = line[11:].strip() elif line.startswith("Version:"): version_string = line[8:].strip() - matched_pair = re.search("(.+)\((.+)\)", version_string) + matched_pair = re.search(r"(.+)\((.+)\)", version_string) if matched_pair: self.crashlog.process_version = matched_pair.group(1) self.crashlog.process_compatability_version = matched_pair.group(2) diff --git a/lldb/examples/python/symbolication.py b/lldb/examples/python/symbolication.py index f6dcc8b9a7943..b16745ee963c9 100755 --- a/lldb/examples/python/symbolication.py +++ b/lldb/examples/python/symbolication.py @@ -177,9 +177,9 @@ class Section: """Class that represents an load address range""" sect_info_regex = re.compile("(?P[^=]+)=(?P.*)") - addr_regex = re.compile("^\s*(?P0x[0-9A-Fa-f]+)\s*$") + addr_regex = re.compile(r"^\s*(?P0x[0-9A-Fa-f]+)\s*$") range_regex = re.compile( - "^\s*(?P0x[0-9A-Fa-f]+)\s*(?P[-+])\s*(?P0x[0-9A-Fa-f]+)\s*$" + r"^\s*(?P0x[0-9A-Fa-f]+)\s*(?P[-+])\s*(?P0x[0-9A-Fa-f]+)\s*$" ) def __init__(self, start_addr=None, end_addr=None, name=None): @@ -557,7 +557,7 @@ def find_images_with_identifier(self, identifier): if image.identifier == identifier: images.append(image) if len(images) == 0: - regex_text = "^.*\.%s$" % (re.escape(identifier)) + regex_text = r"^.*\.%s$" % (re.escape(identifier)) regex = re.compile(regex_text) for image in self.images: if regex.match(image.identifier):