Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3e30fd7

Browse files
committed
Merge 3.5 (imp/_imp)
2 parents ff6cae3 + cd6e694 commit 3e30fd7

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Python/pylifecycle.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,13 @@ import_init(PyInterpreterState *interp, PyObject *sysmod)
252252
interp->importlib = importlib;
253253
Py_INCREF(interp->importlib);
254254

255-
/* Install _importlib as __import__ */
255+
/* Import the _imp module */
256256
impmod = PyInit_imp();
257257
if (impmod == NULL) {
258-
Py_FatalError("Py_Initialize: can't import imp");
258+
Py_FatalError("Py_Initialize: can't import _imp");
259259
}
260260
else if (Py_VerboseFlag) {
261-
PySys_FormatStderr("import imp # builtin\n");
261+
PySys_FormatStderr("import _imp # builtin\n");
262262
}
263263
sys_modules = PyImport_GetModuleDict();
264264
if (Py_VerboseFlag) {
@@ -268,6 +268,7 @@ import_init(PyInterpreterState *interp, PyObject *sysmod)
268268
Py_FatalError("Py_Initialize: can't save _imp to sys.modules");
269269
}
270270

271+
/* Install importlib as the implementation of import */
271272
value = PyObject_CallMethod(importlib, "_install", "OO", sysmod, impmod);
272273
if (value == NULL) {
273274
PyErr_Print();

0 commit comments

Comments
 (0)