From 8ed4d2d0dedc4880fb1a09ed5393239f2a597be2 Mon Sep 17 00:00:00 2001 From: "Brett T. Warden" Date: Mon, 20 Nov 2023 12:51:47 -0800 Subject: [PATCH] Fix regex escaping in vendor.py Address this warning from Python: SyntaxWarning: invalid escape sequence '\-' --- vendor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor.py b/vendor.py index 23ab9a7..8faf706 100755 --- a/vendor.py +++ b/vendor.py @@ -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"