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-03-29 21:44:14 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2009-03-29 21:44:14 +0400
commit68e088f1cf3e3b8daa4a5d17acb6f0525ca6de95 (patch)
treea7b25263104f72f16d340119a09fcbcf29f8e695 /source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp
parentd79ddebaaec697e1775a6f652a1ee064eb053bf4 (diff)
Improvements on error handling in the Python API.
Diffstat (limited to 'source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp')
-rw-r--r--source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp b/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp
index 7116c574c76..12c79743559 100644
--- a/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp
+++ b/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp
@@ -150,10 +150,8 @@ int Chain___init__(BPy_Chain *self, PyObject *args, PyObject *kwds)
PyObject * Chain_push_viewedge_back( BPy_Chain *self, PyObject *args ) {
PyObject *obj1 = 0, *obj2 = 0;
- if(!( PyArg_ParseTuple(args, "OO", &obj1, &obj2) && BPy_ViewEdge_Check(obj1) && PyBool_Check(obj2) )) {
- cout << "ERROR: Chain_push_viewedge_back" << endl;
- Py_RETURN_NONE;
- }
+ if(!( PyArg_ParseTuple(args, "O!O!", &ViewEdge_Type, &obj1, &PyBool_Type, &obj2) ))
+ return NULL;
ViewEdge *ve = ((BPy_ViewEdge *) obj1)->ve;
bool orientation = bool_from_PyBool( obj2 );
@@ -165,10 +163,8 @@ PyObject * Chain_push_viewedge_back( BPy_Chain *self, PyObject *args ) {
PyObject * Chain_push_viewedge_front( BPy_Chain *self, PyObject *args ) {
PyObject *obj1 = 0, *obj2 = 0;
- if(!( PyArg_ParseTuple(args, "OO", &obj1, &obj2) && BPy_ViewEdge_Check(obj1) && PyBool_Check(obj2) )) {
- cout << "ERROR: Chain_push_viewedge_front" << endl;
- Py_RETURN_NONE;
- }
+ if(!( PyArg_ParseTuple(args, "O!O!", &ViewEdge_Type, &obj1, &PyBool_Type, &obj2) ))
+ return NULL;
ViewEdge *ve = ((BPy_ViewEdge *) obj1)->ve;
bool orientation = bool_from_PyBool( obj2 );