Skip to content

Commit dae4a01

Browse files
mrwigglewafflesmasahir0y
authored andcommitted
gen_compile_commands: fix invalid escape sequence warning
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>
1 parent e3a9ee9 commit dae4a01

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
@@ -170,7 +170,7 @@ def process_line(root_directory, command_prefix, file_path):
170170
# escape the pound sign '#', either as '\#' or '$(pound)' (depending on the
171171
# kernel version). The compile_commands.json file is not interepreted
172172
# by Make, so this code replaces the escaped version with '#'.
173-
prefix = command_prefix.replace('\#', '#').replace('$(pound)', '#')
173+
prefix = command_prefix.replace(r'\#', '#').replace('$(pound)', '#')
174174

175175
# Return the canonical path, eliminating any symbolic links encountered in the path.
176176
abs_path = os.path.realpath(os.path.join(root_directory, file_path))

0 commit comments

Comments
 (0)