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-30 01:50:10 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2009-03-30 01:50:10 +0400
commita377b74638245f8eb1a956c9840e16a448de553e (patch)
treef9d9197211b89561069bf887de764468924ab9e7 /source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp
parentfbd92e985ed5bf19a92839b4b3fec9a93ce6519f (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.cpp11
1 files changed, 3 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 12c79743559..f30b2bbdd96 100644
--- a/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp
+++ b/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp
@@ -125,18 +125,13 @@ int Chain___init__(BPy_Chain *self, PyObject *args, PyObject *kwds)
self->c = new Chain();
} else if( BPy_Chain_Check(obj) ) {
- if( ((BPy_Chain *) obj)->c )
- self->c = new Chain(*( ((BPy_Chain *) obj)->c ));
- else
- return -1;
+ self->c = new Chain(*( ((BPy_Chain *) obj)->c ));
} else if( BPy_Id_Check(obj) ) {
- if( ((BPy_Id *) obj)->id )
- self->c = new Chain(*( ((BPy_Id *) obj)->id ));
- else
- return -1;
+ self->c = new Chain(*( ((BPy_Id *) obj)->id ));
} else {
+ PyErr_SetString(PyExc_TypeError, "invalid argument");
return -1;
}