Merge pull request #25528 from asmorkalov:as/python_hdr_parser_fix

Fixed SyntaxWarning: invalid escape sequence '\w' in header parser.
pull/25532/head
Alexander Smorkalov 9 months ago committed by GitHub
commit 7ea4364c63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      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

Loading…
Cancel
Save