diff options
author | Ken Hughes <khughes@pacific.edu> | 2006-05-01 09:28:51 +0400 |
---|---|---|
committer | Ken Hughes <khughes@pacific.edu> | 2006-05-01 09:28:51 +0400 |
commit | 02506b1a5bd67769a10c69329ad4a32a673c0bf5 (patch) | |
tree | 8d30dcd755ac6ff7910b561eb68b714e273ea6bf /source/blender/python/api2_2x/gen_utils.c | |
parent | 066a2b2ed2194ea72ae90f006f2f2be76014c7ca (diff) |
===Python API===
Make EXPP_setBitfield() PyObject_IsTrue() to evaluate parameter, so
boolean-type attribute setters will accept wider range of true/false inputs.
Diffstat (limited to 'source/blender/python/api2_2x/gen_utils.c')
-rw-r--r-- | source/blender/python/api2_2x/gen_utils.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/source/blender/python/api2_2x/gen_utils.c b/source/blender/python/api2_2x/gen_utils.c index 4460a93d38f..4489b215313 100644 --- a/source/blender/python/api2_2x/gen_utils.c +++ b/source/blender/python/api2_2x/gen_utils.c @@ -825,15 +825,7 @@ PyObject *EXPP_getBitfield( void *param, int setting, char type ) int EXPP_setBitfield( PyObject * value, void *param, int setting, char type ) { - int flag; - char errstr[] = "expected TRUE or FALSE (1 or 0)"; - - if( !PyInt_CheckExact ( value ) ) - return EXPP_ReturnIntError( PyExc_TypeError, errstr ); - - flag = PyInt_AS_LONG ( value ); - if( flag != 0 && flag != 1 ) - return EXPP_ReturnIntError( PyExc_ValueError, errstr ); + int flag = PyObject_IsTrue( value ); switch ( type ) { case 'b': |