bpo-32030: pass interp to _PyImport_Init() (#4736) · pythoncapi/cpython@672b6ba · GitHub
Skip to content

Commit 672b6ba

Browse files
authored
bpo-32030: pass interp to _PyImport_Init() (python#4736)
Remove also the initstr variable, unused since the commit e69f0df pushed in 2012: "bpo-13959: Re-implement imp.find_module() in Lib/imp.py"
1 parent a2a25eb commit 672b6ba

3 files changed

Lines changed: 3 additions & 11 deletions

File tree

Include/pylifecycle.h

Lines changed: 1 addition & 1 deletion

Python/import.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ extern struct _inittab _PyImport_Inittab[];
3131

3232
struct _inittab *PyImport_Inittab = _PyImport_Inittab;
3333

34-
static PyObject *initstr = NULL;
35-
3634
/*[clinic input]
3735
module _imp
3836
[clinic start generated code]*/
@@ -43,14 +41,8 @@ module _imp
4341
/* Initialize things */
4442

4543
_PyInitError
46-
_PyImport_Init(void)
44+
_PyImport_Init(PyInterpreterState *interp)
4745
{
48-
PyInterpreterState *interp = PyThreadState_Get()->interp;
49-
initstr = PyUnicode_InternFromString("__init__");
50-
if (initstr == NULL) {
51-
return _Py_INIT_ERR("Can't initialize import variables");
52-
}
53-
5446
interp->builtins_copy = PyDict_Copy(interp->builtins);
5547
if (interp->builtins_copy == NULL) {
5648
return _Py_INIT_ERR("Can't backup builtins dict");

Python/pylifecycle.c

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)