patchtest: Use raw strings for regex patterns

This fixes several 'SyntaxWarning: invalid escape sequence' messages
printed when running patchtest.

Cc: Trevor Gamblin <tgamblin@baylibre.com>
(From OE-Core rev: c585977a6b55db93b7f432280ae4251aa9bc6b6c)

Signed-off-by: Paul Barker <paul@pbarker.dev>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Barker
2025-09-24 20:57:47 +01:00
committed by Richard Purdie
parent ad8e8fe79c
commit 9f7c6b7a09
2 changed files with 12 additions and 12 deletions

View File

@@ -71,7 +71,7 @@ class TestMbox(base.Base):
def test_shortlog_length(self):
for commit in self.commits:
# no reason to re-check on revert shortlogs
shortlog = re.sub('^(\[.*?\])+ ', '', commit.shortlog)
shortlog = re.sub(r'^(\[.*?\])+ ', '', commit.shortlog)
if shortlog.startswith('Revert "'):
continue
l = len(shortlog)
@@ -109,7 +109,7 @@ class TestMbox(base.Base):
# a meta project may be indicted in the message subject, if this is the case, just fail
# TODO: there may be other project with no-meta prefix, we also need to detect these
project_regex = pyparsing.Regex("\[(?P<project>meta-.+)\]")
project_regex = pyparsing.Regex(r"\[(?P<project>meta-.+)\]")
for commit in self.commits:
match = project_regex.search_string(commit.subject)
if match: