From 68e088f1cf3e3b8daa4a5d17acb6f0525ca6de95 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Sun, 29 Mar 2009 17:44:14 +0000 Subject: Improvements on error handling in the Python API. --- .../freestyle/intern/python/BPy_Interface1D.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'source/blender/freestyle/intern/python/BPy_Interface1D.cpp') diff --git a/source/blender/freestyle/intern/python/BPy_Interface1D.cpp b/source/blender/freestyle/intern/python/BPy_Interface1D.cpp index cfa9c3066a1..b6a6501c540 100644 --- a/source/blender/freestyle/intern/python/BPy_Interface1D.cpp +++ b/source/blender/freestyle/intern/python/BPy_Interface1D.cpp @@ -246,10 +246,8 @@ PyObject *Interface1D_getTimeStamp( BPy_Interface1D *self ) { PyObject *Interface1D_setTimeStamp( BPy_Interface1D *self, PyObject *args) { int timestamp = 0 ; - if( !PyArg_ParseTuple(args, (char *)"i", ×tamp) ) { - cout << "ERROR: Interface1D_setTimeStamp" << endl; - Py_RETURN_NONE; - } + if( !PyArg_ParseTuple(args, "i", ×tamp) ) + return NULL; self->if1D->setTimeStamp( timestamp ); @@ -270,10 +268,8 @@ PyObject * Interface1D_verticesEnd( BPy_Interface1D *self ) { PyObject * Interface1D_pointsBegin( BPy_Interface1D *self, PyObject *args ) { float f = 0; - if(!( PyArg_ParseTuple(args, "|f", &f) )) { - cout << "ERROR: Interface1D_pointsBegin" << endl; - Py_RETURN_NONE; - } + if(!( PyArg_ParseTuple(args, "|f", &f) )) + return NULL; Interface0DIterator if0D_it( self->if1D->pointsBegin(f) ); return BPy_Interface0DIterator_from_Interface0DIterator( if0D_it ); @@ -282,10 +278,8 @@ PyObject * Interface1D_pointsBegin( BPy_Interface1D *self, PyObject *args ) { PyObject * Interface1D_pointsEnd( BPy_Interface1D *self, PyObject *args ) { float f = 0; - if(!( PyArg_ParseTuple(args, "|f", &f) )) { - cout << "ERROR: Interface1D_pointsEnd" << endl; - Py_RETURN_NONE; - } + if(!( PyArg_ParseTuple(args, "|f", &f) )) + return NULL; Interface0DIterator if0D_it( self->if1D->pointsEnd(f) ); return BPy_Interface0DIterator_from_Interface0DIterator( if0D_it ); -- cgit v1.2.3