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:
authorDaniel Genrich <daniel.genrich@gmx.net>2008-06-30 19:02:22 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2008-06-30 19:02:22 +0400
commit90c2c290587ac74eac310fd407adf5ffe1a2f619 (patch)
tree82e57f8b66432ac66a13106ad41350999bc63914 /source/blender/python
parent5b15a610ee2688a42f24b6ef16a7fce5a4aa96df (diff)
Fix for python APi error - (Campbell: please check :) ) -- using myLamp.setType(Area) resulted in 'TypeError: expected int argument in [0,5]' (reported in IRC by Djoef)
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/api2_2x/Lamp.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/source/blender/python/api2_2x/Lamp.c b/source/blender/python/api2_2x/Lamp.c
index d9034847a85..53d25a6429d 100644
--- a/source/blender/python/api2_2x/Lamp.c
+++ b/source/blender/python/api2_2x/Lamp.c
@@ -1520,14 +1520,9 @@ static PyObject *Lamp_oldsetType( BPy_Lamp * self, PyObject * value )
char *type = PyString_AsString(value);
PyObject *arg, *error;
- /* parse string argument */
-
- if( !value )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" ) );
-
+ /* parse string argument */
if( !type )
- return EXPP_ReturnPyObjError ( PyExc_AttributeError,
+ return EXPP_ReturnPyObjError ( PyExc_TypeError,
"expected string argument" );
/* check for valid arguments, set type accordingly */
@@ -1550,7 +1545,7 @@ static PyObject *Lamp_oldsetType( BPy_Lamp * self, PyObject * value )
/* build tuple, call wrapper */
- arg = Py_BuildValue( "(i)", type );
+ arg = Py_BuildValue( "(i)", self->lamp->type );
error = EXPP_setterWrapper ( (void *)self, arg, (setter)Lamp_setType );
Py_DECREF ( arg );
return error;