Skip to content

Commit 22010dc

Browse files
committed
fix(cross-project-tests/**.py): fix invalid escape sequences
1 parent fc21387 commit 22010dc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cross-project-tests/debuginfo-tests/dexter/dex/command/ParseCommand.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def get_address_object(address_name: str, offset: int = 0):
128128

129129

130130
def _search_line_for_cmd_start(line: str, start: int, valid_commands: dict) -> int:
131-
"""Scan `line` for a string matching any key in `valid_commands`.
131+
r"""Scan `line` for a string matching any key in `valid_commands`.
132132
133133
Start searching from `start`.
134134
Commands escaped with `\` (E.g. `\DexLabel('a')`) are ignored.
@@ -543,7 +543,7 @@ def test_parse_share_line(self):
543543
def test_parse_escaped(self):
544544
"""Escaped commands are ignored."""
545545

546-
lines = ['words \MockCmd("IGNORED") words words words\n']
546+
lines = ['words \\MockCmd("IGNORED") words words words\n']
547547

548548
values = self._find_all_mock_values_in_lines(lines)
549549

cross-project-tests/lit.cfg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def can_target_host():
226226
xcode_lldb_vers = subprocess.check_output(["xcrun", "lldb", "--version"]).decode(
227227
"utf-8"
228228
)
229-
match = re.search("lldb-(\d+)", xcode_lldb_vers)
229+
match = re.search(r"lldb-(\d+)", xcode_lldb_vers)
230230
if match:
231231
apple_lldb_vers = int(match.group(1))
232232
if apple_lldb_vers < 1000:
@@ -250,7 +250,7 @@ def get_gdb_version_string():
250250
if len(gdb_vers_lines) < 1:
251251
print("Unkown GDB version format (too few lines)", file=sys.stderr)
252252
return None
253-
match = re.search("GNU gdb \(.*?\) ((\d|\.)+)", gdb_vers_lines[0].strip())
253+
match = re.search(r"GNU gdb \(.*?\) ((\d|\.)+)", gdb_vers_lines[0].strip())
254254
if match is None:
255255
print(f"Unkown GDB version format: {gdb_vers_lines[0]}", file=sys.stderr)
256256
return None
@@ -264,7 +264,7 @@ def get_clang_default_dwarf_version_string(triple):
264264
# Get the flags passed by the driver and look for -dwarf-version.
265265
cmd = f'{llvm_config.use_llvm_tool("clang")} -g -xc -c - -v -### --target={triple}'
266266
stderr = subprocess.run(cmd.split(), stderr=subprocess.PIPE).stderr.decode()
267-
match = re.search("-dwarf-version=(\d+)", stderr)
267+
match = re.search(r"-dwarf-version=(\d+)", stderr)
268268
if match is None:
269269
print("Cannot determine default dwarf version", file=sys.stderr)
270270
return None

0 commit comments

Comments
 (0)