mirror of
https://github.com/asterisk/asterisk.git
synced 2026-04-25 16:24:29 +00:00
astconfigparser.py: Fix regex pattern error by properly escaping string
"SyntaxWarning: invalid escape sequence '\s'" occurs when using the pjsip migration script because '\' is an escape character in Python. Instead, use a raw string for the regex.
This commit is contained in:
committed by
Asterisk Development Team
parent
09e87f5a15
commit
08e66e2e07
@@ -240,7 +240,7 @@ def try_include(line):
|
||||
included filename, otherwise None.
|
||||
"""
|
||||
|
||||
match = re.match('^#include\s*([^;]+).*$', line)
|
||||
match = re.match(r'^#include\s*([^;]+).*$', line)
|
||||
if match:
|
||||
trimmed = match.group(1).rstrip()
|
||||
quoted = re.match('^"([^"]+)"$', trimmed)
|
||||
|
||||
Reference in New Issue
Block a user