From: Pink Serenity Date: Mon, 24 Feb 2025 08:28:18 +0000 (+0100) Subject: [py] fix regex not using raw string (closes gh-416, thanks to @PinkSerenity) X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=46f78469bbc589e7f981d3fad2dc917e9d6222ae;p=aubio.git [py] fix regex not using raw string (closes gh-416, thanks to @PinkSerenity) --- 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