Improvements in error handling at Python-C++ boundaries.

This commit is contained in:
2009-03-20 22:41:27 +00:00
parent 6ba34d18b5
commit 0c7e5323e8
24 changed files with 280 additions and 227 deletions

View File

@@ -160,13 +160,17 @@ PyObject * UnaryFunction0DId___call__( BPy_UnaryFunction0DId *self, PyObject *ar
{
PyObject *obj;
if(!PyArg_ParseTuple(args, "O!", &Interface0DIterator_Type, &obj)) {
cout << "ERROR: UnaryFunction0DId___call__ " << endl;
if(!PyArg_ParseTuple(args, "O!", &Interface0DIterator_Type, &obj))
return NULL;
if (self->uf0D_id->operator()(*( ((BPy_Interface0DIterator *) obj)->if0D_it )) < 0) {
if (!PyErr_Occurred()) {
string msg(self->uf0D_id->getName() + " __call__ method failed");
PyErr_SetString(PyExc_RuntimeError, msg.c_str());
}
return NULL;
}
Id id( self->uf0D_id->operator()(*( ((BPy_Interface0DIterator *) obj)->if0D_it )) );
return BPy_Id_from_Id( id );
return BPy_Id_from_Id( self->uf0D_id->result );
}
///////////////////////////////////////////////////////////////////////////////////////////