-- Fix bugs caused (by me) by incorrect use of Py_RETURN_NONE macro in
"if" statements. The macro defined in gen_utils.h expands to two statements; putting after an "if" statement without {} means the second statement should always be executed. I'm not sure if just putting braces around both statements would cause other compilers to complain. But this explains an earlier bug in the Object module which only appeared on MacOS/X.
This commit is contained in:
parent
b2e32f5bd1
commit
427cae9eeb
|
@ -530,8 +530,9 @@ static PyObject *KeyBlock_getData( PyObject * self )
|
|||
BPy_KeyBlock *kb = ( BPy_KeyBlock * ) self;
|
||||
Key *key = kb->key;
|
||||
|
||||
if( !kb->keyblock->data )
|
||||
if( !kb->keyblock->data ) {
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
l = PyList_New( kb->keyblock->totelem );
|
||||
if( !l )
|
||||
|
|
|
@ -2760,8 +2760,9 @@ static PyObject *Object_getAttr( BPy_Object * obj, char *name )
|
|||
if( StringEqual( name, "parent" ) ) {
|
||||
if( object->parent )
|
||||
return Object_CreatePyObject( object->parent );
|
||||
else
|
||||
else {
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
}
|
||||
if( StringEqual( name, "parentbonename" ) ) {
|
||||
if( object->parent && object->parsubstr[0] )
|
||||
|
|
Loading…
Reference in New Issue