python-2.6.2 Exception: TypeError: "'NoneType' object is not callable" in ignored

Poor Yorick org.python.pythonlist at
Sun Jun 14 22:19:28 EDT 2009

Terry Reedy wrote:
 > Poor Yorick wrote:
 >> The following code produces an error (python-2.6.2).
 > You forgot to post the error traceback.

There was no traceback, but following John Machin's prodding, I read back
through some older posts (including one of yours) which I hadn't guessed were
relevant the first time around.  It seems that the program itself was
functioning properly, but when the interpreter exited, objects were being
deleted in an order which did not permit orderly teardown of other objects.  I
hadn't thought to look, before, but despite the warnings, the exit status of
the interpreter was 0.  The solution to the errors was to register a teardown
function in the module:

     import atexit

     def teardown():
         del globals()['d1']



More information about the Python-list mailing list