Commit dae4a017 authored by Andrew Ballance's avatar Andrew Ballance Committed by Masahiro Yamada
Browse files

gen_compile_commands: fix invalid escape sequence warning



With python 3.12, '\#' results in this warning
    SyntaxWarning: invalid escape sequence '\#'

Signed-off-by: default avatarAndrew Ballance <andrewjballance@gmail.com>
Reviewed-by: default avatarJustin Stitt <justinstitt@google.com>
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent e3a9ee96
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ def process_line(root_directory, command_prefix, file_path):
    # escape the pound sign '#', either as '\#' or '$(pound)' (depending on the
    # kernel version). The compile_commands.json file is not interepreted
    # by Make, so this code replaces the escaped version with '#'.
    prefix = command_prefix.replace('\#', '#').replace('$(pound)', '#')
    prefix = command_prefix.replace(r'\#', '#').replace('$(pound)', '#')

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