diff options
author | Gabi Falk <gabifalk@gmx.com> | 2024-04-15 23:38:27 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-04-30 04:34:04 +0100 |
commit | a447cd6dee206facb66720bdacf0c765a8b09f33 (patch) | |
tree | e61d4589649360ae20a21d0e99d07f9cef5ee92e | |
parent | 15.0.0: init, clone of 14.0.0 (diff) | |
download | gcc-patches-a447cd6dee206facb66720bdacf0c765a8b09f33.tar.gz gcc-patches-a447cd6dee206facb66720bdacf0c765a8b09f33.tar.bz2 gcc-patches-a447cd6dee206facb66720bdacf0c765a8b09f33.zip |
validate_failures.py: fix python 3.12 escape sequence warnings
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.
Link: https://docs.python.org/dev/whatsnew/3.12.html#other-language-changes
Link: https://github.com/python/cpython/issues/98401
[sam: Pull in https://inbox.sourceware.org/gcc-patches/20240415233833.104460-1-gabifalk@gmx.com/.}
[sam: Add bug reference to https://bugs.gentoo.org/929834]
Bug: https://bugs.gentoo.org/929834
Signed-off-by: Gabi Falk <gabifalk@gmx.com>
Signed-off-by: Sam James <sam@gentoo.org>
-rwxr-xr-x | scripts/testsuite-management/validate_failures.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/testsuite-management/validate_failures.py b/scripts/testsuite-management/validate_failures.py index f81ac4f..e5188bb 100755 --- a/scripts/testsuite-management/validate_failures.py +++ b/scripts/testsuite-management/validate_failures.py @@ -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' |