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_Interface1D.cpp | |
parent | d79ddebaaec697e1775a6f652a1ee064eb053bf4 (diff) |
Improvements on error handling in the Python API.
Diffstat (limited to 'source/blender/freestyle/intern/python/BPy_Interface1D.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/BPy_Interface1D.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
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 ); |