oeqa/gitarchive: Fix syntax warning

The backslash characters cause syntax warnings, mark the strings are raw
to avoid this.

(From OE-Core rev: abbe836162a24de5f22b38e8a2e547607e429820)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit f717f61a37ed83618d054fc4017b5f5386fb2e3c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
Richard Purdie 2024-12-03 13:43:30 +00:00 committed by Steve Sakoman
parent d78b78df91
commit e35b91ea4d

View File

@ -146,7 +146,7 @@ def expand_tag_strings(repo, name_pattern, msg_subj_pattern, msg_body_pattern,
keyws['tag_number'] = '{tag_number}' keyws['tag_number'] = '{tag_number}'
tag_re = format_str(name_pattern, keyws) tag_re = format_str(name_pattern, keyws)
# Replace parentheses for proper regex matching # Replace parentheses for proper regex matching
tag_re = tag_re.replace('(', '\(').replace(')', '\)') + '$' tag_re = tag_re.replace('(', r'\(').replace(')', r'\)') + '$'
# Inject regex group pattern for 'tag_number' # Inject regex group pattern for 'tag_number'
tag_re = tag_re.format(tag_number='(?P<tag_number>[0-9]{1,5})') tag_re = tag_re.format(tag_number='(?P<tag_number>[0-9]{1,5})')