From 46f78469bbc589e7f981d3fad2dc917e9d6222ae Mon Sep 17 00:00:00 2001 From: Pink Serenity Date: Mon, 24 Feb 2025 09:28:18 +0100 Subject: [PATCH] [py] fix regex not using raw string (closes gh-416, thanks to @PinkSerenity) --- python/lib/gen_code.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/lib/gen_code.py b/python/lib/gen_code.py index be7fec65..95b9fa54 100644 --- a/python/lib/gen_code.py +++ b/python/lib/gen_code.py @@ -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 -- 2.11.0