From 5aaa570fefaf22c4e8537288d85feec16cae9480 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 2 May 2024 20:38:23 +0300 Subject: [PATCH] Fixed SyntaxWarning: invalid escape sequence '\w' in header parser. --- modules/python/src2/hdr_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/python/src2/hdr_parser.py b/modules/python/src2/hdr_parser.py index d4a5b26a9f..fa2d0077d9 100755 --- a/modules/python/src2/hdr_parser.py +++ b/modules/python/src2/hdr_parser.py @@ -513,9 +513,9 @@ class CppHeaderParser(object): if rettype == classname or rettype == "~" + classname: rettype, funcname = "", rettype else: - if bool(re.match('\w+\s+\(\*\w+\)\s*\(.*\)', decl_str)): + if bool(re.match(r'\w+\s+\(\*\w+\)\s*\(.*\)', decl_str)): return [] # function typedef - elif bool(re.match('\w+\s+\(\w+::\*\w+\)\s*\(.*\)', decl_str)): + elif bool(re.match(r'\w+\s+\(\w+::\*\w+\)\s*\(.*\)', decl_str)): return [] # class method typedef elif bool(re.match('[A-Z_]+', decl_start)): return [] # it seems to be a macro instantiation