mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-81057: Move PyImport_Inittab to _PyRuntimeState (gh-99402)
We actually don't move PyImport_Inittab. Instead, we make a copy that we keep on _PyRuntimeState and use only that after Py_Initialize(). We also prevent folks from modifying PyImport_Inittab (the best we can) after that point. https://github.com/python/cpython/issues/81057
This commit is contained in:
parent
67807cfc87
commit
7f3a4b967c
9 changed files with 80 additions and 8 deletions
|
@ -605,6 +605,11 @@ pycore_init_runtime(_PyRuntimeState *runtime,
|
|||
return status;
|
||||
}
|
||||
|
||||
status = _PyImport_Init();
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
status = _PyInterpreterState_Enable(runtime);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue