chore: Fix SyntaxWarning: invalid escape sequence '\+'

This commit is contained in:
Lzu Tao 2024-09-17 08:17:07 +07:00 committed by pancake
parent b9fbf3082d
commit 7e91c52473

View File

@ -80,7 +80,7 @@ def main():
lines_by_file = {}
input = sys.stdin.read().split('\n')
for lineidx, line in enumerate(input):
match = re.search('^\+\+\+\ (.*?/){%s}(\S*)' % args.p, line)
match = re.search(r'^\+\+\+\ (.*?/){%s}(\S*)' % args.p, line)
if match:
filename = match.group(2)
if filename is None:
@ -93,7 +93,7 @@ def main():
if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE):
continue
match = re.search('^@@.*\+(\d+)(,(\d+))?', line)
match = re.search(r'^@@.*\+(\d+)(,(\d+))?', line)
if match:
start_line = int(match.group(1))
line_count = 1