diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2009-03-21 01:41:27 +0300 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2009-03-21 01:41:27 +0300 |
commit | 0c7e5323e891e5b32b4bfae58115137e805adfeb (patch) | |
tree | a92d0320b3bef22e80683cf38d4b241a9e35806e /source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp | |
parent | 6ba34d18b55bedbddb750e5231a2aec9a1fbbac0 (diff) |
Improvements in error handling at Python-C++ boundaries.
Diffstat (limited to 'source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp index e636e554e21..abcbdbaebab 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp @@ -166,13 +166,17 @@ PyObject * UnaryFunction0DViewShape___call__( BPy_UnaryFunction0DViewShape *self { PyObject *obj; - if(!PyArg_ParseTuple(args, "O!", &Interface0DIterator_Type, &obj)) { - cout << "ERROR: UnaryFunction0DViewShape___call__ " << endl; + if(!PyArg_ParseTuple(args, "O!", &Interface0DIterator_Type, &obj)) + return NULL; + + if (self->uf0D_viewshape->operator()(*( ((BPy_Interface0DIterator *) obj)->if0D_it )) < 0) { + if (!PyErr_Occurred()) { + string msg(self->uf0D_viewshape->getName() + " __call__ method failed"); + PyErr_SetString(PyExc_RuntimeError, msg.c_str()); + } return NULL; } - - ViewShape *vs = self->uf0D_viewshape->operator()(*( ((BPy_Interface0DIterator *) obj)->if0D_it )); - return BPy_ViewShape_from_ViewShape( *vs ); + return BPy_ViewShape_from_ViewShape( *(self->uf0D_viewshape->result) ); } |