diff options
| author | Emil Velikov <emil.l.velikov@gmail.com> | 2024-09-22 20:44:59 +0100 |
|---|---|---|
| committer | Mario Limonciello <superm1@gmail.com> | 2024-10-10 14:33:32 +0000 |
| commit | 737e6f37c06570bcf4ed3707baccbcd38a6c03c4 (patch) | |
| tree | 67a3b3b8811f619063926977cdf80aca8bcfa383 /check_whence.py | |
| parent | 1dbbc8fb826775b6ad8e77aa76dc19f67c6aff97 (diff) | |
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>
Diffstat (limited to 'check_whence.py')
| -rwxr-xr-x | check_whence.py | 6 |
1 files changed, 3 insertions, 3 deletions
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) |
