Stefan Seefeld wrote: > hello, > > I'v run into a bug that I find hard to understand: > > In a python module of mine I import system modules > ('sys', say) and then use them from within some functions. > > However, during program termination I'm calling > one such function and the module reference ('sys') > is 'None' !
Do You register Your function using atexit() ? This works perfectly fine and as expected for me. I would wonder if the interpreter was shut down and tries to execute a cleanup thereafter. Checkout following example code. You may also have a look at the /lib/atexit.py module see how it works. import atexit import sys def foo(): print sys atexit.register(foo) Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list