|
From: <bc...@wo...> - 2001-12-18 10:52:21
|
[Ype Kingma] >Dear jythoneers, > >This is a rather involved bug, so I hope it is JVM dependent. >It shows up in rather unusual circumstances. [example running __del__() method in clear globals snipped] It isn't really a mystery and exactly the same thing happens in CPython. When the __del__() is executed, the globals no longer have a reference to the module level println function. The result is a common NameError exception. Unfortunately Jython 2.1b1 doesn't inform you of the exception in the way it should. When I fix that bug, your program will the same way, but it will write: __main__.executor Hello <<unknown>.deltest1 instance at 6467398> Hello2 <<unknown>.deltest2 instance at 5935979> after del __main__.executor Goodbye <<unknown>.deltest1 instance at 6467398> Goodbye2 <<unknown>.deltest2 instance at 5935979> __main__.clearingExecutor Hello <<unknown>.deltest1 instance at 13226366> Goodbye <<unknown>.deltest1 instance at 13226366> Hello2 <<unknown>.deltest2 instance at 14919969> Exception NameError: println in <unbound method deltest2.__del__> ignored after del __main__.clearingExecutor which at least contain a usefull hint about the real problem. Thanks for making the example available. Without it, the bug would never have been uncovered this easily. regards, finn |