Skip to content

Commit a715100

Browse files
mrwigglewafflesroxanan1996
authored andcommitted
gen_compile_commands: fix invalid escape sequence warning
BugLink: https://bugs.launchpad.net/bugs/2063290 [ Upstream commit dae4a01 ] With python 3.12, '\#' results in this warning SyntaxWarning: invalid escape sequence '\#' Signed-off-by: Andrew Ballance <andrewjballance@gmail.com> Reviewed-by: Justin Stitt <justinstitt@google.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Portia Stephens <portia.stephens@canonical.com> Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
1 parent ad1a48e commit a715100

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/clang-tools/gen_compile_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def process_line(root_directory, command_prefix, file_path):
184184
# escape the pound sign '#', either as '\#' or '$(pound)' (depending on the
185185
# kernel version). The compile_commands.json file is not interepreted
186186
# by Make, so this code replaces the escaped version with '#'.
187-
prefix = command_prefix.replace('\#', '#').replace('$(pound)', '#')
187+
prefix = command_prefix.replace(r'\#', '#').replace('$(pound)', '#')
188188

189189
# Use os.path.abspath() to normalize the path resolving '.' and '..' .
190190
abs_path = os.path.abspath(os.path.join(root_directory, file_path))

0 commit comments

Comments
 (0)