New submission from Petr Viktorin:
When this program is invoked as a script (`python reproducer.py`), the __del__
is never called:
---
class ClassWithDel:
def __del__(self):
print('__del__ called')
a = ClassWithDel()
a.link = a
raise SystemExit(0)
---
Raising a different exception, moving the code to a function, importing the
module, or invoking with -m (or even -c), causes __del__ to be called normally.
----------
components: Interpreter Core
messages: 246491
nosy: encukou
priority: normal
severity: normal
status: open
title: Script globals in a GC cycle not finalized when exiting with SystemExit
versions: Python 3.4, Python 3.5, Python 3.6
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue24596>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com