repopick: Fix regex related SyntaxWarning on Python 3.12

Change-Id: I23f80997f34a158d564a2e41043242a5af9f2ac3
This commit is contained in:
LuK1337
2023-09-20 20:28:20 +02:00
parent 231338af58
commit 0ddf65dc8d

View File

@@ -234,7 +234,7 @@ if __name__ == '__main__':
for pline in plist.splitlines():
matchObj = re.match(r'Local Branches.*\[(.*)\]', pline)
if matchObj:
local_branches = re.split('\s*,\s*', matchObj.group(1))
local_branches = re.split(r'\s*,\s*', matchObj.group(1))
if any(args.start_branch[0] in s for s in local_branches):
needs_abandon = True
@@ -298,7 +298,7 @@ if __name__ == '__main__':
reviews = fetch_query(args.gerrit, args.query)
change_numbers = [str(r['number']) for r in sorted(reviews, key=cmp_to_key(cmp_reviews))]
if args.change_number:
change_url_re = re.compile('https?://.+?/([0-9]+(?:/[0-9]+)?)/?')
change_url_re = re.compile(r'https?://.+?/([0-9]+(?:/[0-9]+)?)/?')
for c in args.change_number:
change_number = change_url_re.findall(c)
if change_number: