diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-12-06 17:25:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-06 17:25:50 +0100 |
commit | 672b6baa71010f236ee8c8ce912e98cb542385c6 (patch) | |
tree | 542982cb63ada027c915497b3a703a6f46d0e5c4 /Python/import.c | |
parent | a2a25eb03762680b98bb8cd090e43d0994a72c49 (diff) | |
download | cpython-git-672b6baa71010f236ee8c8ce912e98cb542385c6.tar.gz |
bpo-32030: pass interp to _PyImport_Init() (#4736)
Remove also the initstr variable, unused since the commit
e69f0df45b709c25ac80617c41bbae16f56870fb pushed in 2012: "bpo-13959:
Re-implement imp.find_module() in Lib/imp.py"
Diffstat (limited to 'Python/import.c')
-rw-r--r-- | Python/import.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/Python/import.c b/Python/import.c index 57521e4920..9a9857385c 100644 --- a/Python/import.c +++ b/Python/import.c @@ -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]*/ @@ -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"); |