From: Emil Velikov Date: Sun, 22 Sep 2024 19:44:59 +0000 (+0100) Subject: check_whence.py: annotate replacement strings as raw X-Git-Tag: 20241017~9^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=737e6f37c06570bcf4ed3707baccbcd38a6c03c4;p=thirdparty%2Flinux-firmware.git check_whence.py: annotate replacement strings as raw Otherwise python 3.12 throws warnings like below: .../check_whence.py:40: SyntaxWarning: invalid escape sequence '\ ' yield match.group(1).replace("\ ", " ").replace('"', "") Signed-off-by: Emil Velikov --- diff --git a/check_whence.py b/check_whence.py index dbbb68f7..64dc1335 100755 --- a/check_whence.py +++ b/check_whence.py @@ -37,7 +37,7 @@ def list_whence_files(): for line in whence: match = re.match(r"(?:RawFile|File):\s*(.*)", line) if match: - yield match.group(1).replace("\ ", " ").replace('"', "") + yield match.group(1).replace(r"\ ", " ").replace('"', "") continue @@ -48,8 +48,8 @@ def list_links_list(): if match: linkname, target = match.group(1).split("->") - linkname = linkname.strip().replace("\ ", " ").replace('"', "") - target = target.strip().replace("\ ", " ").replace('"', "") + linkname = linkname.strip().replace(r"\ ", " ").replace('"', "") + target = target.strip().replace(r"\ ", " ").replace('"', "") # Link target is relative to the link target = os.path.join(os.path.dirname(linkname), target)