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>2011-02-01 10:15:57 -0200
commit5132ceaac226b604ba02d335fa10d95a0bda6d5b (patch)
tree8f6d4aef9a51c7e1555550a2dbffa8e795e2dc12
parent35fde19b7177e2cf2af5fa155a80b64e37eae976 (diff)
downloadshiboken-5132ceaac226b604ba02d335fa10d95a0bda6d5b.tar.gz
shiboken-5132ceaac226b604ba02d335fa10d95a0bda6d5b.tar.xz
shiboken-5132ceaac226b604ba02d335fa10d95a0bda6d5b.zip
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 9b9c9108..9f49eec3 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;