Skip to content

Commit 6ce8cc5

Browse files
mrwigglewafflesSasha Levin
authored andcommitted
gen_compile_commands: fix invalid escape sequence warning
[ Upstream commit dae4a01 ] With python 3.12, '\#' results in this warning SyntaxWarning: invalid escape sequence '\#' Signed-off-by: Andrew Ballance <[email protected]> Reviewed-by: Justin Stitt <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent d1614e1 commit 6ce8cc5

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
# Use os.path.abspath() to normalize the path resolving '.' and '..' .
176176
abs_path = os.path.abspath(os.path.join(root_directory, file_path))

0 commit comments

Comments
 (0)