Skip to content

[cross-project-tests] Fix invalid escape sequences #94031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def get_address_object(address_name: str, offset: int = 0):


def _search_line_for_cmd_start(line: str, start: int, valid_commands: dict) -> int:
"""Scan `line` for a string matching any key in `valid_commands`.
r"""Scan `line` for a string matching any key in `valid_commands`.

Start searching from `start`.
Commands escaped with `\` (E.g. `\DexLabel('a')`) are ignored.
Expand Down Expand Up @@ -543,7 +543,7 @@ def test_parse_share_line(self):
def test_parse_escaped(self):
"""Escaped commands are ignored."""

lines = ['words \MockCmd("IGNORED") words words words\n']
lines = ['words \\MockCmd("IGNORED") words words words\n']

values = self._find_all_mock_values_in_lines(lines)

Expand Down
6 changes: 3 additions & 3 deletions cross-project-tests/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def can_target_host():
xcode_lldb_vers = subprocess.check_output(["xcrun", "lldb", "--version"]).decode(
"utf-8"
)
match = re.search("lldb-(\d+)", xcode_lldb_vers)
match = re.search(r"lldb-(\d+)", xcode_lldb_vers)
if match:
apple_lldb_vers = int(match.group(1))
if apple_lldb_vers < 1000:
Expand All @@ -247,7 +247,7 @@ def get_gdb_version_string():
if len(gdb_vers_lines) < 1:
print("Unkown GDB version format (too few lines)", file=sys.stderr)
return None
match = re.search("GNU gdb \(.*?\) ((\d|\.)+)", gdb_vers_lines[0].strip())
match = re.search(r"GNU gdb \(.*?\) ((\d|\.)+)", gdb_vers_lines[0].strip())
if match is None:
print(f"Unkown GDB version format: {gdb_vers_lines[0]}", file=sys.stderr)
return None
Expand All @@ -261,7 +261,7 @@ def get_clang_default_dwarf_version_string(triple):
# Get the flags passed by the driver and look for -dwarf-version.
cmd = f'{llvm_config.use_llvm_tool("clang")} -g -xc -c - -v -### --target={triple}'
stderr = subprocess.run(cmd.split(), stderr=subprocess.PIPE).stderr.decode()
match = re.search("-dwarf-version=(\d+)", stderr)
match = re.search(r"-dwarf-version=(\d+)", stderr)
if match is None:
print("Cannot determine default dwarf version", file=sys.stderr)
return None
Expand Down
Loading