]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-101659: Add _Py_AtExit() (gh-103298)
authorEric Snow <ericsnowcurrently@gmail.com>
Thu, 6 Apr 2023 00:42:02 +0000 (18:42 -0600)
committerGitHub <noreply@github.com>
Thu, 6 Apr 2023 00:42:02 +0000 (18:42 -0600)
commit03089fdccc7dbe3f69227fbd570df92278371e7f
tree3b5440d14daa9f23689bfb2e07d0730f3839b219
parent4ec8dd10bd4682793559c4eccbcf6ae00688c4c3
gh-101659: Add _Py_AtExit() (gh-103298)

The function is like Py_AtExit() but for a single interpreter.  This is a companion to the atexit module's register() function, taking a C callback instead of a Python one.

We also update the _xxinterpchannels module to use _Py_AtExit(), which is the motivating case.  (This is inspired by pain points felt while working on gh-101660.)
13 files changed:
Include/cpython/pylifecycle.h
Include/internal/pycore_atexit.h [new file with mode: 0644]
Include/internal/pycore_interp.h
Include/internal/pycore_runtime.h
Lib/test/test__xxinterpchannels.py
Makefile.pre.in
Modules/_testcapimodule.c
Modules/_xxinterpchannelsmodule.c
Modules/_xxsubinterpretersmodule.c
Modules/atexitmodule.c
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters
Python/pylifecycle.c