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/utils.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/utils.py')
-rw-r--r-- | meta/lib/patchtest/utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/lib/patchtest/utils.py b/meta/lib/patchtest/utils.py index a4a523b4e2..dd0abc22d9 100644 --- a/meta/lib/patchtest/utils.py +++ b/meta/lib/patchtest/utils.py | |||
@@ -132,7 +132,7 @@ def get_subject_prefix(path): | |||
132 | if len(mbox): | 132 | if len(mbox): |
133 | subject = mbox[0]['subject'] | 133 | subject = mbox[0]['subject'] |
134 | if subject: | 134 | if subject: |
135 | pattern = re.compile("(\[.*\])", re.DOTALL) | 135 | pattern = re.compile(r"(\[.*\])", re.DOTALL) |
136 | match = pattern.search(subject) | 136 | match = pattern.search(subject) |
137 | if match: | 137 | if match: |
138 | prefix = match.group(1) | 138 | prefix = match.group(1) |
@@ -146,8 +146,8 @@ def valid_branch(branch): | |||
146 | invalid = lbranch.startswith('patch') or \ | 146 | invalid = lbranch.startswith('patch') or \ |
147 | lbranch.startswith('rfc') or \ | 147 | lbranch.startswith('rfc') or \ |
148 | lbranch.startswith('resend') or \ | 148 | lbranch.startswith('resend') or \ |
149 | re.search('^v\d+', lbranch) or \ | 149 | re.search(r'^v\d+', lbranch) or \ |
150 | re.search('^\d+/\d+', lbranch) | 150 | re.search(r'^\d+/\d+', lbranch) |
151 | 151 | ||
152 | return not invalid | 152 | return not invalid |
153 | 153 | ||