Fix regex escaping in vendor.py

Address this warning from Python:
SyntaxWarning: invalid escape sequence '\-'
This commit is contained in:
Brett T. Warden
2023-11-20 12:51:47 -08:00
parent 023a2da624
commit 8ed4d2d0de
+2 -2
View File
@@ -97,8 +97,8 @@ def update_cargo_sources(name, tag):
with open('Makefile', encoding='utf8') as mfile:
for line in mfile.readlines():
if line.startswith('ARCHIVES'):
if re.match(archive_match + '[a-zA-Z0-9_\-.]+\.tar\.xz', line):
new_archives = re.sub(archive_match + '[a-zA-Z0-9_\-.]+\.tar\.xz',
if re.match(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.xz', line):
new_archives = re.sub(archive_match + r'[a-zA-Z0-9_\-.]+\.tar\.xz',
f"{archive_match}-{tag}.tar.xz\n", line)
else:
new_archives = f"ARCHIVES = {archive_match}-{tag}.tar.xz ./vendor\n"