From 76f95779deec77596a5d50837a12edd9f4836449 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Sat, 10 Aug 2024 13:14:47 +1000 Subject: [PATCH] Fixes --- scripts/sipify.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/sipify.py b/scripts/sipify.py index cd4c89db589..5dfe9091fb8 100755 --- a/scripts/sipify.py +++ b/scripts/sipify.py @@ -1903,10 +1903,10 @@ while line_idx < line_count: pattern = r'^\s*(?:const |virtual |static |inline )*(?!explicit)([(?:long )\w:]+(?:<.*?>)?)\s+(?:\*|&)?(?:\w+|operator.{1,2})\(.*$' match = re.match(pattern, LINE) if match: - return_type = match.group(1) - if not re.search(r'(void|SIP_PYOBJECT|operator|return|QFlag)', return_type): + return_type_candidate = match.group(1) + if not re.search(r'(void|SIP_PYOBJECT|operator|return|QFlag)', return_type_candidate): # replace :: with . (changes c++ style namespace/class directives to Python style) - return_type = return_type.replace('::', '.') + return_type = return_type_candidate.replace('::', '.') # replace with builtin Python types return_type = re.sub(r'\bdouble\b', 'float', return_type) return_type = re.sub(r'\bQString\b', 'str', return_type)