]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-46417: Finalize structseq types at exit (GH-30645)
authorVictor Stinner <vstinner@python.org>
Fri, 21 Jan 2022 00:42:25 +0000 (01:42 +0100)
committerGitHub <noreply@github.com>
Fri, 21 Jan 2022 00:42:25 +0000 (01:42 +0100)
commite9e3eab0b868c7d0b48e472705024240d5c39d5c
tree65c254d948a37dd822085887ebb84f390ad48d94
parent27df7566bc19699b967e0e30d7808637b90141f6
bpo-46417: Finalize structseq types at exit (GH-30645)

Add _PyStructSequence_FiniType() and _PyStaticType_Dealloc()
functions to finalize a structseq static type in Py_Finalize().
Currrently, these functions do nothing if Python is built in release
mode.

Clear static types:

* AsyncGenHooksType: sys.set_asyncgen_hooks()
* FlagsType: sys.flags
* FloatInfoType: sys.float_info
* Hash_InfoType: sys.hash_info
* Int_InfoType: sys.int_info
* ThreadInfoType: sys.thread_info
* UnraisableHookArgsType: sys.unraisablehook
* VersionInfoType: sys.version
* WindowsVersionType: sys.getwindowsversion()
17 files changed:
Include/internal/pycore_floatobject.h
Include/internal/pycore_long.h
Include/internal/pycore_pyerrors.h
Include/internal/pycore_pylifecycle.h
Include/internal/pycore_typeobject.h
Include/structseq.h
Lib/test/_test_embed_structseq.py [new file with mode: 0644]
Lib/test/test_embed.py
Objects/floatobject.c
Objects/longobject.c
Objects/structseq.c
Objects/typeobject.c
Programs/_testembed.c
Python/errors.c
Python/pylifecycle.c
Python/sysmodule.c
Python/thread.c