mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
bpo-38858: new_interpreter() reuses pycore_init_builtins() (GH-17351)
new_interpreter() now calls _PyBuiltin_Init() to create the builtins module and calls _PyImport_FixupBuiltin(), rather than using _PyImport_FindBuiltin(tstate, "builtins"). pycore_init_builtins() is now responsible to initialize intepr->builtins_copy: inline _PyImport_Init() and remove this function.
This commit is contained in:
parent
82c83bd907
commit
2582d46fbc
4 changed files with 24 additions and 43 deletions
|
@ -48,17 +48,6 @@ module _imp
|
|||
|
||||
/* Initialize things */
|
||||
|
||||
PyStatus
|
||||
_PyImport_Init(PyThreadState *tstate)
|
||||
{
|
||||
PyInterpreterState *interp = tstate->interp;
|
||||
interp->builtins_copy = PyDict_Copy(interp->builtins);
|
||||
if (interp->builtins_copy == NULL) {
|
||||
return _PyStatus_ERR("Can't backup builtins dict");
|
||||
}
|
||||
return _PyStatus_OK();
|
||||
}
|
||||
|
||||
PyStatus
|
||||
_PyImportHooks_Init(PyThreadState *tstate)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue