Ariel Otilibili has uploaded this change for review. ( 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:
``` $ python3 util/lint/checkpatch_json.py util/lint/checkpatch_json.py:42: SyntaxWarning: invalid escape sequence '\d' elif re.search("^\d+:\Z",line) != "None" and line.startswith("#"): HELP: util/lint/checkpatch_json.py <input file> <output file in json> <job-id> <job-url> ```
Using raw strings clear out the warning:
``` $ python3 util/lint/checkpatch_json.py HELP: util/lint/checkpatch_json.py <input file> <output file in json> <job-id> <job-url> ```
Link: https://docs.python.org/3.12/whatsnew/3.12.html#other-language-changes Change-Id: I0177dc7f0d3013759879320afdb6ab548d356bc7 Cc: Martin Roth gaumless@gmail.com Signed-off-by: Ariel Otilibili otilibil@eurecom.fr --- M util/lint/checkpatch_json.py 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/85771/1
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