diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-07-12 15:51:21 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-07-12 15:51:21 +0400 |
commit | bfb9603cb47e524439d76f1ec303423b8ab8e9c3 (patch) | |
tree | f56bb85b85e262d918c7938073f98c0b6cb3ea9c /source/blender/python/api2_2x/SurfNurb.c | |
parent | e7c15b97e24c1923df8bef96ac35f9abd17c7964 (diff) |
From stable
Revision: 11237
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11237
Author: campbellbarton
Date: 2007-07-12 13:05:31 +0200 (Thu, 12 Jul 2007)
Log Message:
-----------
PyObject_IsTrue was missing a check for an error return value in many cases.
Diffstat (limited to 'source/blender/python/api2_2x/SurfNurb.c')
-rw-r--r-- | source/blender/python/api2_2x/SurfNurb.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/python/api2_2x/SurfNurb.c b/source/blender/python/api2_2x/SurfNurb.c index 0cac359dcf9..b758c6b2e65 100644 --- a/source/blender/python/api2_2x/SurfNurb.c +++ b/source/blender/python/api2_2x/SurfNurb.c @@ -457,9 +457,14 @@ static PyObject *SurfNurb_getCyclicV( BPy_SurfNurb * self ) Py_RETURN_FALSE; } -static int SurfNurb_setCyclicU( BPy_SurfNurb * self, PyObject * args ) +static int SurfNurb_setCyclicU( BPy_SurfNurb * self, PyObject * value ) { - if( PyObject_IsTrue( args ) ) + int param = PyObject_IsTrue( value ); + if( param == -1 ) + return EXPP_ReturnIntError( PyExc_TypeError, + "expected True/False or 0/1" ); + + if( param ) self->nurb->flagu |= CU_CYCLIC; else self->nurb->flagu &= ~CU_CYCLIC; @@ -467,9 +472,14 @@ static int SurfNurb_setCyclicU( BPy_SurfNurb * self, PyObject * args ) return 0; } -static int SurfNurb_setCyclicV( BPy_SurfNurb * self, PyObject * args ) +static int SurfNurb_setCyclicV( BPy_SurfNurb * self, PyObject * value ) { - if( PyObject_IsTrue( args ) ) + int param = PyObject_IsTrue( value ); + if( param == -1 ) + return EXPP_ReturnIntError( PyExc_TypeError, + "expected True/False or 0/1" ); + + if( param ) self->nurb->flagv |= CU_CYCLIC; else self->nurb->flagv &= ~CU_CYCLIC; |