-- 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:
Ken Hughes 2005-11-28 05:21:25 +00:00
parent b2e32f5bd1
commit 427cae9eeb
2 changed files with 4 additions and 2 deletions

View File

@ -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 )

View File

@ -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] )