This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 7aa2dc24cd0a8d54d139430c9e7c2916a477913b Author: yinshengkai <yinsheng...@xiaomi.com> AuthorDate: Fri Nov 15 12:30:56 2024 +0800 tools/gdb: fix checkpatch warning Use Python raw strings to avoid escaping: SyntaxWarning: invalid escape sequence '\?' Signed-off-by: yinshengkai <yinsheng...@xiaomi.com> --- tools/gdb/nuttxgdb/macros.py | 110 +++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/tools/gdb/nuttxgdb/macros.py b/tools/gdb/nuttxgdb/macros.py index aca22a47f3..bbfdfa019e 100644 --- a/tools/gdb/nuttxgdb/macros.py +++ b/tools/gdb/nuttxgdb/macros.py @@ -45,60 +45,60 @@ import time from os import path PUNCTUATORS = [ - "\[", - "\]", - "\(", - "\)", - "\{", - "\}", - "\?", - ";", - ",", - "~", - "\.\.\.", - "\.", - "\-\>", - "\-\-", - "\-\=", - "\-", - "\+\+", - "\+\=", - "\+", - "\*\=", - "\*", - "\!\=", - "\!", - "\&\&", - "\&\=", - "\&", - "\/\=", - "\/", - "\%\>", - "%:%:", - "%:", - "%=", - "%", - "\^\=", - "\^", - "\#\#", - "\#", - "\:\>", - "\:", - "\|\|", - "\|\=", - "\|", - "<<=", - "<<", - "<=", - "<:", - "<%", - "<", - ">>=", - ">>", - ">=", - ">", - "\=\=", - "\=", + r"\[", + r"\]", + r"\(", + r"\)", + r"\{", + r"\}", + r"\?", + r";", + r",", + r"~", + r"\.\.\.", + r"\.", + r"\-\>", + r"\-\-", + r"\-\=", + r"\-", + r"\+\+", + r"\+\=", + r"\+", + r"\*\=", + r"\*", + r"\!\=", + r"\!", + r"\&\&", + r"\&\=", + r"\&", + r"\/\=", + r"\/", + r"\%\>", + r"%:%:", + r"%:", + r"%=", + r"%", + r"\^\=", + r"\^", + r"\#\#", + r"\#", + r"\:\>", + r"\:", + r"\|\|", + r"\|\=", + r"\|", + r"<<=", + r"<<", + r"<=", + r"<:", + r"<%", + r"<", + r">>=", + r">>", + r">=", + r">", + r"\=\=", + r"\=", ] @@ -134,7 +134,7 @@ def fetch_macro_info(file): hash = hashlib.md5(f.read()).hexdigest() macros = {} - p = re.compile(".*macro[ ]*:[ ]*([\S]+\(.*?\)|[\w]+)[ ]*(.*)") + p = re.compile(r".*macro[ ]*:[ ]*([\S]+\(.*?\)|[\w]+)[ ]*(.*)") cache = path.join(path.dirname(path.abspath(file)), f"{hash}.json") print(f"Load macro: {cache}") if not path.isfile(cache):