[py] fix regex not using raw string (closes gh-416, thanks to @PinkSerenity)
authorPink Serenity <pink_serenity@outlook.de>
Mon, 24 Feb 2025 08:28:18 +0000 (09:28 +0100)
committerPaul Brossier <piem@piem.org>
Sat, 15 Nov 2025 11:23:30 +0000 (12:23 +0100)
python/lib/gen_code.py

index be7fec6..95b9fa5 100644 (file)
@@ -109,7 +109,7 @@ def get_name(proto):
 
 def get_return_type(proto):
     import re
-    paramregex = re.compile('(\w+ ?\*?).*')
+    paramregex = re.compile(r'(\w+ ?\*?).*')
     outputs = paramregex.findall(proto)
     assert len(outputs) == 1
     return outputs[0].replace(' ', '')
@@ -140,7 +140,7 @@ def get_params(proto):
     returns: ['int argc', 'char ** argv']
     """
     import re
-    paramregex = re.compile('.*\((.*)\);')
+    paramregex = re.compile(r'.*\((.*)\);')
     a = paramregex.findall(proto)[0].split(', ')
     #a = [i.replace('const ', '') for i in a]
     return a