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 <emil.l.velikov@gmail.com>
This commit is contained in:
Emil Velikov 2024-09-22 20:44:59 +01:00 committed by Mario Limonciello
parent 1dbbc8fb82
commit 737e6f37c0

View file

@ -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)