mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-11 07:24:46 +00:00
scripts: gen_compile_commands: fix invalid escape sequence warning
Since Python 3.12 unrecognised escape sequences trigger a SyntaxWarning. Convert the '\#' string to a raw string so the backslash is correctly used as a literal. Ported from Linux commit dae4a0171e25 ("gen_compile_commands: fix invalid escape sequence warning"). This updates the script to be in-line with Linux 6.9-rc6. Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org> Reviewed-by: João Marcos Costa <jmcosta944@gmail.com>
This commit is contained in:
parent
4f652182a0
commit
830d83ec38
1 changed files with 1 additions and 1 deletions
|
@ -172,7 +172,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))
|
||||
|
|
Loading…
Add table
Reference in a new issue