comparison Python/pythonrun.c @ 76331:d777f854a66e

Issue #13959: Rename imp to _imp and add Lib/imp.py and begin rewriting functionality in pure Python. To start, imp.new_module() has been rewritten in pure Python, put into importlib (privately) and then publicly exposed in imp.
author Brett Cannon <brett@python.org>
date Sun, 15 Apr 2012 16:08:47 -0400
parents c7bf93802f5d
children 57d558f1904d
comparison
equal deleted inserted replaced
76330:95c29787320a 76331:d777f854a66e
223 } 223 }
224 sys_modules = PyImport_GetModuleDict(); 224 sys_modules = PyImport_GetModuleDict();
225 if (Py_VerboseFlag) { 225 if (Py_VerboseFlag) {
226 PySys_FormatStderr("import sys # builtin\n"); 226 PySys_FormatStderr("import sys # builtin\n");
227 } 227 }
228 if (PyDict_SetItemString(sys_modules, "imp", impmod) < 0) { 228 if (PyDict_SetItemString(sys_modules, "_imp", impmod) < 0) {
229 Py_FatalError("Py_Initialize: can't save imp to sys.modules"); 229 Py_FatalError("Py_Initialize: can't save _imp to sys.modules");
230 } 230 }
231 231
232 value = PyObject_CallMethod(importlib, "_setup", "OO", sysmod, impmod); 232 value = PyObject_CallMethod(importlib, "_setup", "OO", sysmod, impmod);
233 if (value == NULL) { 233 if (value == NULL) {
234 PyErr_Print(); 234 PyErr_Print();