bpo-32030: pass interp to _PyImport_Init() by vstinner · Pull Request #4736 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Include/pylifecycle.h
10 changes: 1 addition & 9 deletions Python/import.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ extern struct _inittab _PyImport_Inittab[];

struct _inittab *PyImport_Inittab = _PyImport_Inittab;

static PyObject *initstr = NULL;

/*[clinic input]
module _imp
[clinic start generated code]*/
Expand All @@ -43,14 +41,8 @@ module _imp
/* Initialize things */

_PyInitError
_PyImport_Init(void)
_PyImport_Init(PyInterpreterState *interp)
{
PyInterpreterState *interp = PyThreadState_Get()->interp;
initstr = PyUnicode_InternFromString("__init__");
if (initstr == NULL) {
return _Py_INIT_ERR("Can't initialize import variables");
}

interp->builtins_copy = PyDict_Copy(interp->builtins);
if (interp->builtins_copy == NULL) {
return _Py_INIT_ERR("Can't backup builtins dict");
Expand Down
2 changes: 1 addition & 1 deletion Python/pylifecycle.c