diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2009-03-30 01:50:10 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2009-03-30 01:50:10 +0400 |
commit | a377b74638245f8eb1a956c9840e16a448de553e (patch) | |
tree | f9d9197211b89561069bf887de764468924ab9e7 /source/blender/freestyle/intern/python/BPy_Id.cpp | |
parent | fbd92e985ed5bf19a92839b4b3fec9a93ce6519f (diff) |
Improvements on error handling in the Python API.
Diffstat (limited to 'source/blender/freestyle/intern/python/BPy_Id.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/BPy_Id.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_Id.cpp b/source/blender/freestyle/intern/python/BPy_Id.cpp index 7d8ea07d563..0396e4a36ff 100644 --- a/source/blender/freestyle/intern/python/BPy_Id.cpp +++ b/source/blender/freestyle/intern/python/BPy_Id.cpp @@ -165,10 +165,8 @@ PyObject *Id_getSecond( BPy_Id *self) { PyObject *Id_setFirst( BPy_Id *self , PyObject *args) { unsigned int i; - if( !PyArg_ParseTuple(args, (char *)"i", &i) ) { - cout << "ERROR: Id_setFirst" << endl; - Py_RETURN_NONE; - } + if( !PyArg_ParseTuple(args, "i", &i) ) + return NULL; self->id->setFirst( i ); @@ -179,10 +177,8 @@ PyObject *Id_setFirst( BPy_Id *self , PyObject *args) { PyObject *Id_setSecond( BPy_Id *self , PyObject *args) { unsigned int i; - if( !PyArg_ParseTuple(args, (char *)"i", &i) ) { - cout << "ERROR: Id_setSecond" << endl; - Py_RETURN_NONE; - } + if( !PyArg_ParseTuple(args, "i", &i) ) + return NULL; self->id->setSecond( i ); |