errors in _del__ during python shutdown

gidi_avrahami at gidi_avrahami at
Mon Apr 3 17:46:24 CEST 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):

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
Before you buy.

More information about the Python-list mailing list