From 5609724c2e5b59130c6fcfc128120777282c8d9a Mon Sep 17 00:00:00 2001 From: Eisuke Kawashima Date: Mon, 13 Jan 2025 21:05:10 +0900 Subject: [PATCH] [Polly] Fix invalid escape sequences (#94037) These generate a SyntaxWarning since Python 3.12. --- polly/test/update_check.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/polly/test/update_check.py b/polly/test/update_check.py index 88d95c247c06..a973c72ff4e7 100644 --- a/polly/test/update_check.py +++ b/polly/test/update_check.py @@ -222,7 +222,12 @@ def classyfier2(lines): line = i.__next__() -replrepl = {"{{": "{{[{][{]}}", "}}": "{{[}][}]}}", "[[": "{{\[\[}}", "]]": "{{\]\]}}"} +replrepl = { + "{{": "{{[{][{]}}", + "}}": "{{[}][}]}}", + "[[": r"{{\[\[}}", + "]]": r"{{\]\]}}", +} replre = re.compile("|".join(re.escape(k) for k in replrepl.keys())) @@ -452,7 +457,7 @@ def main(): checkre = re.compile( r"^\s*\;\s*(" + "|".join([re.escape(s) for s in checkprefixes]) - + ")(\-NEXT|\-DAG|\-NOT|\-LABEL|\-SAME)?\s*\:" + + r")(\-NEXT|\-DAG|\-NOT|\-LABEL|\-SAME)?\s*\:" ) firstcheckline = None firstnoncommentline = None