diff options
author | Paul Barker <paul@pbarker.dev> | 2025-09-24 20:57:47 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-10-01 10:52:54 +0100 |
commit | 9f7c6b7a096d0e2b367e7fdda7902a430a5c8705 (patch) | |
tree | c8f26e669c66394519854803f749cfa2b25a806e /meta/lib/patchtest/tests/test_mbox.py | |
parent | ad8e8fe79c3ab5d35a3f0159130f92947203e9eb (diff) | |
download | poky-9f7c6b7a096d0e2b367e7fdda7902a430a5c8705.tar.gz |
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>
Diffstat (limited to 'meta/lib/patchtest/tests/test_mbox.py')
-rw-r--r-- | meta/lib/patchtest/tests/test_mbox.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/patchtest/tests/test_mbox.py b/meta/lib/patchtest/tests/test_mbox.py index 714c9b30af..5cf02af7bd 100644 --- a/meta/lib/patchtest/tests/test_mbox.py +++ b/meta/lib/patchtest/tests/test_mbox.py | |||
@@ -71,7 +71,7 @@ class TestMbox(base.Base): | |||
71 | def test_shortlog_length(self): | 71 | def test_shortlog_length(self): |
72 | for commit in self.commits: | 72 | for commit in self.commits: |
73 | # no reason to re-check on revert shortlogs | 73 | # no reason to re-check on revert shortlogs |
74 | shortlog = re.sub('^(\[.*?\])+ ', '', commit.shortlog) | 74 | shortlog = re.sub(r'^(\[.*?\])+ ', '', commit.shortlog) |
75 | if shortlog.startswith('Revert "'): | 75 | if shortlog.startswith('Revert "'): |
76 | continue | 76 | continue |
77 | l = len(shortlog) | 77 | l = len(shortlog) |
@@ -109,7 +109,7 @@ class TestMbox(base.Base): | |||
109 | 109 | ||
110 | # a meta project may be indicted in the message subject, if this is the case, just fail | 110 | # a meta project may be indicted in the message subject, if this is the case, just fail |
111 | # TODO: there may be other project with no-meta prefix, we also need to detect these | 111 | # TODO: there may be other project with no-meta prefix, we also need to detect these |
112 | project_regex = pyparsing.Regex("\[(?P<project>meta-.+)\]") | 112 | project_regex = pyparsing.Regex(r"\[(?P<project>meta-.+)\]") |
113 | for commit in self.commits: | 113 | for commit in self.commits: |
114 | match = project_regex.search_string(commit.subject) | 114 | match = project_regex.search_string(commit.subject) |
115 | if match: | 115 | if match: |