Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2009-04-04 19:26:12 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2009-04-04 19:26:12 +0400
commit2f5e1969ed6f976930fef2e5e83df80979e22a88 (patch)
treeb017156a2e171b762610c8311f95cf775cc46166 /source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp
parentbff81e3394637638c8af89e91293add488e90168 (diff)
Improvements on error handling in the Python API.
Diffstat (limited to 'source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp')
-rw-r--r--source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp
index ba06d071977..660125a1251 100644
--- a/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp
+++ b/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp
@@ -131,10 +131,8 @@ PyObject * ViewVertex_setNature( BPy_ViewVertex *self, PyObject *args ) {
if( !self->vv )
Py_RETURN_NONE;
- if(!( PyArg_ParseTuple(args, "O", &py_n) && BPy_Nature_Check(py_n) )) {
- cout << "ERROR: ViewVertex_setNature" << endl;
- Py_RETURN_NONE;
- }
+ if(!( PyArg_ParseTuple(args, "O!", &Nature_Type, &py_n) ))
+ return NULL;
PyObject *i = (PyObject *) &( ((BPy_Nature *) py_n)->i );
((ViewVertex *) self->py_if0D.if0D)->setNature( PyInt_AsLong(i) );
@@ -165,10 +163,8 @@ PyObject * ViewVertex_edgesIterator( BPy_ViewVertex *self, PyObject *args ) {
if( !self->vv )
Py_RETURN_NONE;
- if(!( PyArg_ParseTuple(args, "O", &py_ve) && BPy_ViewEdge_Check(py_ve) )) {
- cout << "ERROR: ViewVertex_setNature" << endl;
- Py_RETURN_NONE;
- }
+ if(!( PyArg_ParseTuple(args, "O!", &ViewEdge_Type, &py_ve) ))
+ return NULL;
ViewEdge *ve = ((BPy_ViewEdge *) py_ve)->ve;
ViewVertexInternal::orientedViewEdgeIterator ove_it( self->vv->edgesIterator( ve ) );