diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-06-29 12:59:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-06-29 12:59:26 +0400 |
commit | e192e7e02452c70511f688582d8d95d0a6267ee5 (patch) | |
tree | 75698ba122c3820668888ab38958e5c7e5cbb591 /source/blender/python/api2_2x/bpy_config.c | |
parent | 684869fd74a3a908a5df5802f440bfa823f6c802 (diff) |
remove unneeded checks from the python API
Diffstat (limited to 'source/blender/python/api2_2x/bpy_config.c')
-rw-r--r-- | source/blender/python/api2_2x/bpy_config.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/source/blender/python/api2_2x/bpy_config.c b/source/blender/python/api2_2x/bpy_config.c index 5942ee56256..a061f31d8a0 100644 --- a/source/blender/python/api2_2x/bpy_config.c +++ b/source/blender/python/api2_2x/bpy_config.c @@ -89,10 +89,8 @@ static struct PyMethodDef BPy_Config_methods[] = { */ static PyObject *getStrAttr( BPy_Config *self, void *type ) { - PyObject *attr = NULL; char *param = NULL; - switch( (int)type ) { case EXPP_CONF_ATTR_PATH_YF_EXPORT: param = U.yfexportdir; @@ -127,13 +125,7 @@ static PyObject *getStrAttr( BPy_Config *self, void *type ) "undefined type in getStrAttr" ); } - attr = PyString_FromString( param ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_MemoryError, - "PyString_FromString() failed!" ); + return PyString_FromString( param ); } /* @@ -195,7 +187,6 @@ static int setStrAttr( BPy_Config *self, PyObject *value, void *type ) static PyObject *getIntAttr( BPy_Config *self, void *type ) { - PyObject *attr = NULL; int param; switch( (int)type ) { @@ -220,13 +211,7 @@ static PyObject *getIntAttr( BPy_Config *self, void *type ) "undefined type in getIntAttr" ); } - attr = PyInt_FromLong( param ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_MemoryError, - "PyInt_FromLong() failed!" ); + return PyInt_FromLong( param ); } /* |