From 6423d561db86debe83247f2581b05d9e7f10a57e Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Wed, 2 Mar 2011 10:01:08 -0300 Subject: Handles the situation properly when a custom code has a result value attribution. 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 Reviewed by Luciano Wolf --- generator/cppgenerator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp index ea695280d..a8bb9ce18 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; -- cgit v1.2.3