]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
astconfigparser.py: Fix regex pattern error by properly escaping string
authorJulian C. Dunn <jdunn@aquezada.com>
Wed, 18 Feb 2026 02:06:59 +0000 (18:06 -0800)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Thu, 26 Feb 2026 15:38:22 +0000 (15:38 +0000)
"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.

contrib/scripts/sip_to_pjsip/astconfigparser.py

index eb48b70d7aa5c8ac7ec7af1bfd454f0a7713a685..eb3885ec6ba9e627fffffa60af982847ecd91880 100644 (file)
@@ -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)