aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2021-04-20 17:46:31 +0200
committerChristian Tismer <tismer@stackless.com>2021-04-20 19:00:51 +0200
commit3506158551488788450498f9b4ffe86375172fea (patch)
tree31fefa6ee4c2861a4ea17bceb4d05db2c06da024 /sources
parent1c4b7ddb0f879909f5d2f9f6207c06dfd2493340 (diff)
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 Pick-to: 6.0 Pick-to: 5.15 Change-Id: Ib65682439e2f678380e0f58a42a36506d0766ddf Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources')
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/parser.py4
1 files changed, 3 insertions, 1 deletions
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):