[Bf-python] Metaelem.c clean-up

Kent Mein mein at cs.umn.edu
Tue Aug 30 14:29:06 CEST 2005


In reply to Ken Hughes (khughes at pacific.edu):

> 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

Fix them.  If your worried about commiting them you can always run them by
Jiri Hnidek (jiri.hnidek at vslib..cz)  He's been working on the metaball
stuff.

Kent
-- 
mein at cs.umn.edu
http://www.cs.umn.edu/~mein



More information about the Bf-python mailing list