Felix Singer has submitted this change. ( https://review.coreboot.org/c/coreboot/+/85771?usp=email )
Change subject: util/lint: Clear syntax warnings in Python 3.12 ......................................................................
util/lint: Clear syntax warnings in Python 3.12
Since Python 3.12, invalid escape sequences produce a SyntaxWarning; in the future, they will produce SyntaxError.
Using raw strings clear out the warning.
Below the command used for checking the fix worked.
``` $ python3 util/lint/checkpatch_json.py ```
Link: https://docs.python.org/3.12/whatsnew/3.12.html#other-language-changes Change-Id: I0177dc7f0d3013759879320afdb6ab548d356bc7 Signed-off-by: Ariel Otilibili otilibil@eurecom.fr Reviewed-on: https://review.coreboot.org/c/coreboot/+/85771 Reviewed-by: Maximilian Brune maximilian.brune@9elements.com Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Felix Singer service+coreboot-gerrit@felixsinger.de --- M util/lint/checkpatch_json.py 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: Felix Singer: Looks good to me, approved Maximilian Brune: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/util/lint/checkpatch_json.py b/util/lint/checkpatch_json.py index 967e898..2960b85 100755 --- a/util/lint/checkpatch_json.py +++ b/util/lint/checkpatch_json.py @@ -39,7 +39,7 @@ file_path = temp[1].split(":")[0] line_number = temp[1].split(":")[1] update_struct( file_path.strip(), msg_output, str(line_number) ) - elif re.search("^\d+:\Z",line) != "None" and line.startswith("#"): + elif re.search(r"^\d+:\Z",line) != "None" and line.startswith("#"): file_path="/COMMIT_MSG" line = line.replace('#', '') line_number = int(line.split(":")[0]) + 2