Thanks for your answers! my g_register is a global register, wich contains all my objects and lives all the program lifetime. So 'with' is not appliable. Am I right?
But using atexit sounds to be a good solution On Oct 20, 1:58 pm, Michele Simionato <[EMAIL PROTECTED]> wrote: > On Oct 20, 10:12šam, íÉÔÑ <[EMAIL PROTECTED]> wrote: > > > But when g_register is being destroyed, dump seems to be already dead, > > so I get: > > > Exception exceptions.TypeError: "'NoneType' object is not callable" in > > <bound method __Register.__del__ of <MyWiki.Register.__Register object > > at 0x835a74c>> ignored > > > can I somehow save my data from destructor? > > The best thing is to use the 'with' statement, but it requires you to > rewrite all > of your code. Alternatively you can use the atexit module. I wrote > once a > recipe that may be of interest to you: > > http://code.activestate.com/recipes/523007/ -- http://mail.python.org/mailman/listinfo/python-list