]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-42639: atexit now logs callbacks exceptions (GH-23771)
authorVictor Stinner <vstinner@python.org>
Mon, 14 Dec 2020 22:07:54 +0000 (23:07 +0100)
committerGitHub <noreply@github.com>
Mon, 14 Dec 2020 22:07:54 +0000 (23:07 +0100)
commit357704c9f2375f29ed5b3a93adac086fa714538d
tree8b69403f419da52a6728c8557e1169aaf23c9e2e
parent83d52044ae4def1e8611a4b1b9263b850ca5c458
bpo-42639: atexit now logs callbacks exceptions (GH-23771)

At Python exit, if a callback registered with atexit.register()
fails, its exception is now logged. Previously, only some exceptions
were logged, and the last exception was always silently ignored.

Add _PyAtExit_Call() function and remove
PyInterpreterState.atexit_func member. call_py_exitfuncs() now calls
directly _PyAtExit_Call().

The atexit module must now always be built as a built-in module.
Doc/whatsnew/3.10.rst
Include/internal/pycore_interp.h
Include/internal/pycore_pylifecycle.h
Lib/test/test_threading.py
Misc/NEWS.d/next/Library/2020-12-14-22-31-22.bpo-42639.5Z3iWX.rst [new file with mode: 0644]
Modules/atexitmodule.c
Python/pylifecycle.c
setup.py