diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-03-02 10:01:08 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-03-02 13:46:13 -0300 |
commit | 71cb27e1e11e228a25dcee258ff28d01b983b020 (patch) | |
tree | 74e4755b27bb7cadbe30f92b76a1ea45e84df059 | |
parent | 2d70150f416772b5efc9fb8c669c8c6cedc0146f (diff) | |
download | shiboken-71cb27e1e11e228a25dcee258ff28d01b983b020.tar.gz shiboken-71cb27e1e11e228a25dcee258ff28d01b983b020.tar.xz shiboken-71cb27e1e11e228a25dcee258ff28d01b983b020.zip |
Handles the situation properly when a custom code has a result value attribution.1.0.0
If a method has a custom code that attributes a value to the Python
result variable, Shiboken should not generate code with attribution
to the said variable.
Reviewed by Lauro Moura <lauro.neto@openbossa.org>
Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r-- | generator/cppgenerator.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp index ea695280..a8bb9ce1 100644 --- a/generator/cppgenerator.cpp +++ b/generator/cppgenerator.cpp @@ -2160,7 +2160,8 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f s << methodCall << ';' << endl; s << INDENT << "PyEval_RestoreThread(_save); // Py_END_ALLOW_THREADS" << endl; - if (!isCtor && !func->isInplaceOperator() && func->type()) { + if (!isCtor && !func->isInplaceOperator() && func->type() + && !injectedCodeHasReturnValueAttribution(func, TypeSystem::TargetLangCode)) { s << INDENT << PYTHON_RETURN_VAR " = "; writeToPythonConversion(s, func->type(), func->ownerClass(), CPP_RETURN_VAR); s << ';' << endl; |