mirror of
https://github.com/python/cpython.git
synced 2025-08-25 19:24:42 +00:00
bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874) (GH-26877)
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.
(cherry picked from commit 489699ca05
)
This commit is contained in:
parent
88a3342314
commit
ece3841d3d
6 changed files with 86 additions and 8 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue