From fe58da13930638037283f9a96fc103835b15f919 Mon Sep 17 00:00:00 2001 From: Adrian Freihofer Date: Sat, 10 Feb 2024 14:15:58 +0100 Subject: 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 Signed-off-by: Richard Purdie --- meta/lib/patchtest/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'meta/lib/patchtest/utils.py') 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): if len(mbox): subject = mbox[0]['subject'] if subject: - pattern = re.compile("(\[.*\])", re.DOTALL) + pattern = re.compile(r"(\[.*\])", re.DOTALL) match = pattern.search(subject) if match: prefix = match.group(1) @@ -146,8 +146,8 @@ def valid_branch(branch): invalid = lbranch.startswith('patch') or \ lbranch.startswith('rfc') or \ lbranch.startswith('resend') or \ - re.search('^v\d+', lbranch) or \ - re.search('^\d+/\d+', lbranch) + re.search(r'^v\d+', lbranch) or \ + re.search(r'^\d+/\d+', lbranch) return not invalid -- cgit v1.2.3-54-g00ecf