From 7846820197b95ffc74e899df600542f5f2eaf3c7 Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Tue, 20 Apr 2021 17:46:31 +0200 Subject: signature: Refine the decision heuristics of result tuples Result tuples do not (yet) get information from XML. Instead, they fetch their info solely from the embedded signature strings and information encoded in mapping.py . When a variable is determined as a result variable, it is removed from the arg list and normally appended to the return tuple. It turned out that a special rule is needed: A variable that comes first in the variable list should also be first in the result tuple. This heuristics should be replaced by more introspection. Right now, this suffices as a working fix. Fixes: PYSIDE-1409 Change-Id: Ib65682439e2f678380e0f58a42a36506d0766ddf Reviewed-by: Cristian Maureira-Fredes (cherry picked from commit 3506158551488788450498f9b4ffe86375172fea) Reviewed-by: Qt Cherry-pick Bot --- .../shibokenmodule/files.dir/shibokensupport/signature/parser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/parser.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/parser.py index 84111cdd1..eff73d8a4 100644 --- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/parser.py +++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/parser.py @@ -386,7 +386,9 @@ def fix_variables(props, line): if not isinstance(ann, ResultVariable): continue # We move the variable to the end and remove it. - retvars.append(ann.type) + # PYSIDE-1409: If the variable was the first arg, we move it to the front. + # XXX This algorithm should probably be replaced by more introspection. + retvars.insert(0 if idx == 0 else len(retvars), ann.type) deletions.append(idx) del annos[name] for idx in reversed(deletions): -- cgit v1.2.3