errors in _del__ during python shutdown

gidi_avrahami at my-deja.com gidi_avrahami at my-deja.com
Mon Apr 3 11:46:24 EDT 2000


I have a large Python system with wrappers to some SWIG'ed C code.
Some objects need to do some cleanup in their __del__ , e.g.:

from myBasics import Object
import myCToolkit
kit = myCToolkit

    class SomeObject(Object):
        def __init__(self, *args):
            Object.__init__(self, *args)
            self._vec = kit.float_array(6)
        def __del__(self):
            kit.float_destroy(self._vec)
            Object.__del__(self)

My problem is that when I shut python down (by typing EOF to the prompt), the
SomeObject.__del__ method gets called in a funny state, where 'kit' and even
'Object' are None!  It would appear that Python is "winding down" and starts
killing off modules, even though some objects that refer to these modules
are still alive.

Any ideas?


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list