]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-42639: atexit._run_exitfuncs() uses sys.unraisablehook (GH-23779)
authorVictor Stinner <vstinner@python.org>
Tue, 15 Dec 2020 16:12:02 +0000 (17:12 +0100)
committerGitHub <noreply@github.com>
Tue, 15 Dec 2020 16:12:02 +0000 (17:12 +0100)
commit3ca2b8fd75043927f0bb03b8dac72d32beae255d
tree377eba1ac1a9a69d622a62fd3b33a86f82779d95
parentceb420251c1d635520049fbb7b5269a73d63fb58
bpo-42639: atexit._run_exitfuncs() uses sys.unraisablehook (GH-23779)

atexit._run_exitfuncs() now logs callback exceptions using
sys.unraisablehook, rather than logging them directly into
sys.stderr and raising the last exception.

Run GeneralTest of test_atexit in a subprocess since it calls
atexit._clear() which clears all atexit callbacks.

_PyAtExit_Fini() sets state->callbacks to NULL.
Lib/test/_test_atexit.py [new file with mode: 0644]
Lib/test/test_atexit.py
Lib/test/test_eintr.py
Misc/NEWS.d/next/Library/2020-12-15-15-14-29.bpo-42639.uJ3h8I.rst [new file with mode: 0644]
Modules/atexitmodule.c