mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
019ad62afd
commit
489699ca05
6 changed files with 85 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