]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[contrib] validate_failures.py: fix python 3.12 escape sequence warnings
authorGabi Falk <gabifalk@gmx.com>
Sun, 1 Dec 2024 19:18:18 +0000 (12:18 -0700)
committerJeff Law <jlaw@ventanamicro.com>
Sun, 1 Dec 2024 19:18:18 +0000 (12:18 -0700)
The warnings:
contrib/testsuite-management/validate_failures.py:65: SyntaxWarning: invalid escape sequence '\s'
  _VALID_TEST_RESULTS_REX = re.compile('(%s):\s*(\S+)\s*(.*)'
contrib/testsuite-management/validate_failures.py:77: SyntaxWarning: invalid escape sequence '\.'
  _EXP_LINE_REX = re.compile('^Running (?:.*:)?(.*) \.\.\.\n')

contrib/ChangeLog:
* testsuite-management/validate_failures.py: Change re.compile()
function arguments to Python raw strings.

contrib/testsuite-management/validate_failures.py

index f81ac4f135d242fd2221bf0aa0062747ac7da911..e5188bbf105cc60dc4f4724520358b34cd0d3848 100755 (executable)
@@ -62,7 +62,7 @@ import sys
 
 _VALID_TEST_RESULTS = [ 'FAIL', 'UNRESOLVED', 'XPASS', 'ERROR' ]
 # <STATE>: <NAME> <DESCRIPTION"
-_VALID_TEST_RESULTS_REX = re.compile('(%s):\s*(\S+)\s*(.*)'
+_VALID_TEST_RESULTS_REX = re.compile(r'(%s):\s*(\S+)\s*(.*)'
                                      % "|".join(_VALID_TEST_RESULTS))
 
 # Formats of .sum file sections
@@ -71,11 +71,11 @@ _EXP_LINE_FORMAT = '\nRunning %s:%s ...\n'
 _SUMMARY_LINE_FORMAT = '\n\t\t=== %s Summary ===\n'
 
 # ... and their compiled regexs.
-_TOOL_LINE_REX = re.compile('^\t\t=== (.*) tests ===\n')
+_TOOL_LINE_REX = re.compile(r'^\t\t=== (.*) tests ===\n')
 # Match .exp file name, optionally prefixed by a "tool:" name and a
 # path ending with "testsuite/"
-_EXP_LINE_REX = re.compile('^Running (?:.*:)?(.*) \.\.\.\n')
-_SUMMARY_LINE_REX = re.compile('^\t\t=== (.*) Summary ===\n')
+_EXP_LINE_REX = re.compile(r'^Running (?:.*:)?(.*) \.\.\.\n')
+_SUMMARY_LINE_REX = re.compile(r'^\t\t=== (.*) Summary ===\n')
 
 # Subdirectory of srcdir in which to find the manifest file.
 _MANIFEST_SUBDIR = 'contrib/testsuite-management'