summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-01-31 18:37:49 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:13:52 -0300
commit3b22ffebad4736fafde0ff5a23bb3508be8d4b6d (patch)
treee052df298b735a39d2c4b41622f1c8a15e1e18e4
parente222dba7912df724e3ee6379b12f19e008c770b6 (diff)
Fix bug 655 - "bad re-implementations of QApplication.notify result in a SystemError"
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r--generator/cppgenerator.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index 220975e1..d5697ab7 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -615,6 +615,13 @@ void CppGenerator::writeVirtualMethodNative(QTextStream &s, const AbstractMetaFu
s << INDENT << "Shiboken::GilState gil;" << endl;
+ // Get out of virtual method call if someone already threw an error.
+ s << INDENT << "if (PyErr_Occurred())" << endl;
+ {
+ Indentation indentation(INDENT);
+ s << INDENT << "return " << defaultReturnExpr << ';' << endl;
+ }
+
s << INDENT << "Shiboken::AutoDecRef py_override(Shiboken::BindingManager::instance().getOverride(this, \"";
s << funcName << "\"));" << endl;
@@ -1855,7 +1862,7 @@ void CppGenerator::writeNamedArgumentResolution(QTextStream& s, const AbstractMe
Indentation indent(INDENT);
s << INDENT << pyArgName << " = value;" << endl;
}
- s << "else" << endl;
+ s << INDENT << "else" << endl;
{
Indentation indent(INDENT);
s << INDENT << "goto " << cpythonFunctionName(func) << "_TypeError;" << endl;