I want use ConfigParser in one class, it needs a call from the destructor, but then strange things happen.
This is my code:
"""
function name is
test ok!
test1 failed!
test2 failed!
test3 failed!
test4
... ok!
"""
def test3():
pass
class Class1:
def __del__(self):
test3()
if __name__=="__main__":
obj=Class1()
If the function is named test1
, test2
or test3
, an exception will be raised, and I can't catch it by try except
.
The traceback is:
E:\tc.py
Exception TypeError: "'NoneType' object is not callable" in <bound method Class1.__del__ of <__main__.Class1 instance at 0x00C18F58>> ignored
It's so strange! Can you test it in your system? Or am I doing something wrong?