diff options
author | Victor Stinner <vstinner@python.org> | 2021-06-23 12:13:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-23 12:13:27 (GMT) |
commit | 489699ca05bed5cfd10e847d8580840812b476cd (patch) | |
tree | f58b7493648a430be755b5bc5a788923c8774e62 /Python | |
parent | 019ad62afd20e80c74f879aa716e339b992a0bb9 (diff) | |
download | cpython-489699ca05bed5cfd10e847d8580840812b476cd.zip cpython-489699ca05bed5cfd10e847d8580840812b476cd.tar.gz cpython-489699ca05bed5cfd10e847d8580840812b476cd.tar.bz2 |
bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874)
Py_RunMain() now resets PyImport_Inittab to its initial value at
exit. It must be possible to call PyImport_AppendInittab() or
PyImport_ExtendInittab() at each Python initialization.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/import.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/import.c b/Python/import.c index c4878c6..7301fcc 100644 --- a/Python/import.c +++ b/Python/import.c @@ -255,6 +255,9 @@ _PyImport_Fini2(void) PyMemAllocatorEx old_alloc; _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); + // Reset PyImport_Inittab + PyImport_Inittab = _PyImport_Inittab; + /* Free memory allocated by PyImport_ExtendInittab() */ PyMem_RawFree(inittab_copy); inittab_copy = NULL; |