diff options
author | renato araujo <renato@renato-mac.osmtc.indt.org.br> | 2009-10-20 15:48:11 -0300 |
---|---|---|
committer | renato araujo <renato@renato-mac.osmtc.indt.org.br> | 2009-10-20 15:48:11 -0300 |
commit | 50a75628a9d5ca8dc516c466d97ca0d0cd4004ca (patch) | |
tree | 6dfd9af20eb7c9d5d7a305b398957a66f2c70927 /generators | |
parent | 282b8964740d8f0c4c4b9b10f21622da44c1dbd9 (diff) |
Created execption handle for virtual functions.
Diffstat (limited to 'generators')
-rw-r--r-- | generators/boostpython/cppgenerator.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/generators/boostpython/cppgenerator.cpp b/generators/boostpython/cppgenerator.cpp index 648bf9daa..e3c3b75b8 100644 --- a/generators/boostpython/cppgenerator.cpp +++ b/generators/boostpython/cppgenerator.cpp @@ -681,7 +681,7 @@ void CppGenerator::writeVirtualMethodImplHead(QTextStream& s, const AbstractMeta { Indentation indentation(INDENT); - s << INDENT; + s << INDENT << "try {" << endl << INDENT << INDENT; if (func->type()) s << "python::object __result = "; @@ -717,6 +717,13 @@ void CppGenerator::writeVirtualMethodImplHead(QTextStream& s, const AbstractMeta s << INDENT << "return __return_value;" << endl; } } + + s << INDENT << "} catch (boost::python::error_already_set) {" << endl; + s << INDENT << INDENT << "PyErr_Print();" << endl; + s << INDENT << INDENT << "throw boost::python::error_already_set();" << endl; + s << INDENT << "}" << endl; + + } s << INDENT << "}" << endl; } |