bpf, docs: Fix invalid escape sequence warnings in bpf_doc.py
authorVishal Chourasia <vishalc@linux.ibm.com>
Tue, 29 Aug 2023 07:49:31 +0000 (13:19 +0530)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 31 Aug 2023 11:56:31 +0000 (13:56 +0200)
commit121fd33bf2d99007f8fe2a155c291a30baca3f52
tree11b6b7022edde39befcec701fcd87304d80ae297
parent3e019d8a05a38abb5c85d4f1e85fda964610aa14
bpf, docs: Fix invalid escape sequence warnings in bpf_doc.py

The script bpf_doc.py generates multiple SyntaxWarnings related to invalid
escape sequences when executed with Python 3.12. These warnings do not appear
in Python 3.10 and 3.11 and do not affect the kernel build, which completes
successfully.

This patch resolves these SyntaxWarnings by converting the relevant string
literals to raw strings or by escaping backslashes. This ensures that
backslashes are interpreted as literal characters, eliminating the warnings.

Reported-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Vishal Chourasia <vishalc@linux.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20230829074931.2511204-1-vishalc@linux.ibm.com
scripts/bpf_doc.py