Skip to content

Commit 283a6b9

Browse files
authored
[UTC] Fix SyntaxWarning on Python 3.12 (#82327)
On Python 3.12 we now get a warning in common.py: llvm/utils/UpdateTestChecks/common.py:488: SyntaxWarning: invalid escape sequence '\s' This fixes it by using a raw string literal, see #78036 and https://docs.python.org/3/library/re.html
1 parent 9fa18f6 commit 283a6b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/utils/UpdateTestChecks/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ def invoke_tool(exe, cmd_args, ir, preprocess_cmd=None, verbose=False):
485485
)
486486

487487
UTC_ARGS_KEY = "UTC_ARGS:"
488-
UTC_ARGS_CMD = re.compile(r".*" + UTC_ARGS_KEY + "\s*(?P<cmd>.*)\s*$")
488+
UTC_ARGS_CMD = re.compile(r".*" + UTC_ARGS_KEY + r"\s*(?P<cmd>.*)\s*$")
489489
UTC_ADVERT = "NOTE: Assertions have been autogenerated by "
490490
UTC_AVOID = "NOTE: Do not autogenerate"
491491
UNUSED_NOTE = "NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:"

0 commit comments

Comments
 (0)