mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/
synced 2025-12-19 11:44:43 +08:00
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:
committed by
Mario Limonciello
parent
1dbbc8fb82
commit
737e6f37c0
@@ -37,7 +37,7 @@ def list_whence_files():
|
|||||||
for line in whence:
|
for line in whence:
|
||||||
match = re.match(r"(?:RawFile|File):\s*(.*)", line)
|
match = re.match(r"(?:RawFile|File):\s*(.*)", line)
|
||||||
if match:
|
if match:
|
||||||
yield match.group(1).replace("\ ", " ").replace('"', "")
|
yield match.group(1).replace(r"\ ", " ").replace('"', "")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
||||||
@@ -48,8 +48,8 @@ def list_links_list():
|
|||||||
if match:
|
if match:
|
||||||
linkname, target = match.group(1).split("->")
|
linkname, target = match.group(1).split("->")
|
||||||
|
|
||||||
linkname = linkname.strip().replace("\ ", " ").replace('"', "")
|
linkname = linkname.strip().replace(r"\ ", " ").replace('"', "")
|
||||||
target = target.strip().replace("\ ", " ").replace('"', "")
|
target = target.strip().replace(r"\ ", " ").replace('"', "")
|
||||||
|
|
||||||
# Link target is relative to the link
|
# Link target is relative to the link
|
||||||
target = os.path.join(os.path.dirname(linkname), target)
|
target = os.path.join(os.path.dirname(linkname), target)
|
||||||
|
|||||||
Reference in New Issue
Block a user