Page MenuHome
Authored By
Ken Hughes (khughes)
Nov 13 2013, 12:55 PM
Size
2 KB
Subscribers
None
--- source/blender/python/api2_2x/Object.c 2005/09/25 21:28:18 1.10
+++ source/blender/python/api2_2x/Object.c 2005/09/25 21:32:58
@@ -2540,18 +2540,14 @@
*/
} else if( PySequence_Size( args ) == 3 ) {
- args = PySequence_Fast( args, "expected a sequence of 3 floats" );
for ( i = 0; i < 3; ++i ) {
PyObject *item = PySequence_Fast_GET_ITEM( args, i );
- if( !PyNumber_Check( item ) ) {
- Py_DECREF( args );
+ if( !PyNumber_Check( item ) )
return EXPP_ReturnIntError( PyExc_AttributeError,
"expected euler or list/tuple of 3 floats" );
- }
else
rot[i] = PyFloat_AsDouble( item );
}
- Py_DECREF( args );
} else
return EXPP_ReturnIntError( PyExc_AttributeError,
"expected euler or list/tuple of 3 floats" );
--- source/blender/python/api2_2x/World.c 2005/09/25 21:18:29 1.6
+++ source/blender/python/api2_2x/World.c 2005/09/25 21:32:34
@@ -1034,12 +1034,12 @@
{
int i;
- if( !PyList_Check( value ) || PyList_Size( value ) != 3 )
+ if( !PySequence_Check ( value ) || PySequence_Size( value ) != 3 )
return EXPP_ReturnIntError( PyExc_TypeError,
"expected list of 3 floats" );
for( i = 0; i < 3; ++i ) {
- PyObject *item = PyList_GET_ITEM( value, i );
+ PyObject *item = PySequence_Fast_GET_ITEM( value, i );
if( !item || !PyNumber_Check( item ) )
return EXPP_ReturnIntError( PyExc_TypeError,
"expected list of 3 floats" );
@@ -1132,12 +1132,13 @@
float params[7];
int i;
- if( !PyList_Check( value ) || PyList_Size( value ) != 7 )
+ if( !PySequence_Check( value ) ||
+ PyList_Size( value ) != 7 ) /* need to check for list? */
return EXPP_ReturnIntError( PyExc_TypeError,
"expected list of 7 floats" );
for( i = 0; i < 7; ++i ) {
- PyObject *item = PyList_GET_ITEM( value, i );
+ PyObject *item = PySequence_Fast_GET_ITEM( value, i );
if( !item || !PyNumber_Check( item ) )
return EXPP_ReturnIntError( PyExc_TypeError,
"expected list of 7 floats" );
@@ -1183,12 +1184,13 @@
float params[4];
int i;
- if( !PyList_Check( value ) || PyList_Size( value ) != 4 )
+ if( !PySequence_Check( value ) ||
+ PyList_Size( value ) != 4 )
return EXPP_ReturnIntError( PyExc_TypeError,
"expected list of 4 floats" );
for( i = 0; i < 4; ++i ) {
- PyObject *item = PyList_GET_ITEM( value, i );
+ PyObject *item = PySequence_Fast_GET_ITEM( value, i );
if( !item || !PyNumber_Check( item ) )
return EXPP_ReturnIntError( PyExc_TypeError,
"expected list of 4 floats" );

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1d/4f/63190f8baaddef5c2d8611856f70

Event Timeline