[Bf-python] Metaelem.c clean-up

Ken Hughes khughes at pacific.edu
Tue Aug 30 07:21:00 CEST 2005


Working on tp_getset in Metaball.c today and noticed a bunch of code like:

     if( !PyList_Check( listargs ) )
         return ( EXPP_ReturnPyObjError
              ( PyExc_TypeError, "expected a list" ) );
     type = PyInt_AsLong( PyList_GetItem( listargs, 0 ) );
     x = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 1 ) );
     y = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 2 ) );
     z = (float)PyFloat_AsDouble( PyList_GetItem( listargs, 3 ) );

which means this code:

    x.setStuff(['a'])

seems to execute fine until you quit Blender, when you get this:

   Exception exceptions.TypeError: 'bad argument type for built-in 
operation' in 'garbage collection' ignored
   Fatal Python error: unexpected exception during garbage collection
   Abort

Should I submit a bug report, or just fix it while I make the other 
changes patches?  I've fixed similar code elsewhere in setter methods as 
part of my update, but these are in a function I normally wouldn't change.

Ken



More information about the Bf-python mailing list