diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2009-03-29 21:44:14 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2009-03-29 21:44:14 +0400 |
commit | 68e088f1cf3e3b8daa4a5d17acb6f0525ca6de95 (patch) | |
tree | a7b25263104f72f16d340119a09fcbcf29f8e695 /source/blender/freestyle/intern/python/BPy_ViewMap.cpp | |
parent | d79ddebaaec697e1775a6f652a1ee064eb053bf4 (diff) |
Improvements on error handling in the Python API.
Diffstat (limited to 'source/blender/freestyle/intern/python/BPy_ViewMap.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/BPy_ViewMap.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_ViewMap.cpp b/source/blender/freestyle/intern/python/BPy_ViewMap.cpp index c010236964a..0203a093d74 100644 --- a/source/blender/freestyle/intern/python/BPy_ViewMap.cpp +++ b/source/blender/freestyle/intern/python/BPy_ViewMap.cpp @@ -150,10 +150,8 @@ PyObject * ViewMap___repr__(BPy_ViewMap *self) PyObject * ViewMap_getClosestViewEdge( BPy_ViewMap *self , PyObject *args) { double x, y; - if(!( PyArg_ParseTuple(args, "dd", &x, &y) )) { - cout << "ERROR: ViewMap_getClosestFEdge" << endl; - Py_RETURN_NONE; - } + if(!( PyArg_ParseTuple(args, "dd", &x, &y) )) + return NULL; ViewEdge *ve = const_cast<ViewEdge *>( self->vm->getClosestViewEdge(x,y) ); if( ve ) @@ -165,10 +163,8 @@ PyObject * ViewMap_getClosestViewEdge( BPy_ViewMap *self , PyObject *args) { PyObject * ViewMap_getClosestFEdge( BPy_ViewMap *self , PyObject *args) { double x, y; - if(!( PyArg_ParseTuple(args, "dd", &x, &y) )) { - cout << "ERROR: ViewMap_getClosestFEdge" << endl; - Py_RETURN_NONE; - } + if(!( PyArg_ParseTuple(args, "dd", &x, &y) )) + return NULL; FEdge *fe = const_cast<FEdge *>( self->vm->getClosestFEdge(x,y) ); if( fe ) @@ -185,10 +181,8 @@ PyObject * ViewMap_getScene3dBBox( BPy_ViewMap *self , PyObject *args) { PyObject * ViewMap_setScene3dBBox( BPy_ViewMap *self , PyObject *args) { PyObject *py_bb = 0; - if(!( PyArg_ParseTuple(args, "O", &py_bb) && BPy_BBox_Check(py_bb) )) { - cout << "ERROR: ViewMap_setScene3dBBox" << endl; - Py_RETURN_NONE; - } + if(!( PyArg_ParseTuple(args, "O!", &BBox_Type, &py_bb) )) + return NULL; self->vm->setScene3dBBox(*( ((BPy_BBox *) py_bb)->bb )); |