From: Gabi Falk <gabifalk@gmx.com>
To: gcc-patches@gcc.gnu.org
Cc: Gabi Falk <gabifalk@gmx.com>
Subject: [PATCH] [contrib] validate_failures.py: fix python 3.12 escape sequence warnings
Date: Mon, 15 Apr 2024 23:38:27 +0000 [thread overview]
Message-ID: <20240415233833.104460-1-gabifalk@gmx.com> (raw)
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
Signed-off-by: Gabi Falk <gabifalk@gmx.com>
---
contrib/testsuite-management/validate_failures.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/contrib/testsuite-management/validate_failures.py b/contrib/testsuite-management/validate_failures.py
index f81ac4f135d2..e5188bbf105c 100755
--- a/contrib/testsuite-management/validate_failures.py
+++ b/contrib/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'
--
gabi
reply other threads:[~2024-04-15 23:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240415233833.104460-1-gabifalk@gmx.com \
--to=gabifalk@gmx.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).