diff options
author | Adrian Freihofer <adrian.freihofer@gmail.com> | 2024-02-10 14:15:58 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-13 13:51:41 +0000 |
commit | fe58da13930638037283f9a96fc103835b15f919 (patch) | |
tree | 6687dbd93f42cfb9f4a89e7a096228c2245a2eb8 /meta/lib/patchtest/tests/base.py | |
parent | 7f2755daca55c0abdca9a9a2c01ddc21292a99d6 (diff) | |
download | poky-fe58da13930638037283f9a96fc103835b15f919.tar.gz |
meta/lib/patchtest: python 3.12 regex
Python 3 interprets string literals as Unicode strings, and therefore
\s is treated as an escaped Unicode character which is not correct.
Declaring the RegEx pattern as a raw string instead of unicode is
required for Python 3.
(From OE-Core rev: 329a555f7b8f00c648c44b01f423e6da33a46245)
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/patchtest/tests/base.py')
-rw-r--r-- | meta/lib/patchtest/tests/base.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/patchtest/tests/base.py b/meta/lib/patchtest/tests/base.py index aecbbc4aae..424e61b5be 100644 --- a/meta/lib/patchtest/tests/base.py +++ b/meta/lib/patchtest/tests/base.py | |||
@@ -34,8 +34,8 @@ class PatchtestOEError(Exception): | |||
34 | class Base(unittest.TestCase): | 34 | class Base(unittest.TestCase): |
35 | # if unit test fails, fail message will throw at least the following JSON: {"id": <testid>} | 35 | # if unit test fails, fail message will throw at least the following JSON: {"id": <testid>} |
36 | 36 | ||
37 | endcommit_messages_regex = re.compile('\(From \w+-\w+ rev:|(?<!\S)Signed-off-by|(?<!\S)---\n') | 37 | endcommit_messages_regex = re.compile(r'\(From \w+-\w+ rev:|(?<!\S)Signed-off-by|(?<!\S)---\n') |
38 | patchmetadata_regex = re.compile('-{3} \S+|\+{3} \S+|@{2} -\d+,\d+ \+\d+,\d+ @{2} \S+') | 38 | patchmetadata_regex = re.compile(r'-{3} \S+|\+{3} \S+|@{2} -\d+,\d+ \+\d+,\d+ @{2} \S+') |
39 | 39 | ||
40 | 40 | ||
41 | @staticmethod | 41 | @staticmethod |