OP-TEE / optee_os

Trusted side of the TEE
Other
1.51k stars 1.03k forks source link

SyntaxWarning from gen_compile_commands.py #6896

Closed LuminousXLB closed 1 week ago

LuminousXLB commented 1 week ago

I see there's noqa: W605 to suppress the complaint "Invalid escape sequence" from linter, but this is becoming a SyntaxWarning from Python 3.12 (ref).

https://github.com/OP-TEE/optee_os/blob/956c2d50d60109a6053e14da6ff97d6243ea5d65/scripts/gen_compile_commands.py#L176-L180

I'd propose we properly escape the back slash by changing it to

command_prefix.replace(r'\#', '#')
jforissier commented 1 week ago

Hi @LuminousXLB, your are probably right. Would you mind creating a pull request?

LuminousXLB commented 1 week ago

Yes @jforissier , I've opened a PR on this.