mirror of
https://github.com/python/cpython.git
synced 2025-09-01 14:38:00 +00:00
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.
This commit is contained in:
parent
7788838473
commit
6f44d66bc4
10 changed files with 2850 additions and 2814 deletions
|
@ -225,8 +225,8 @@ import_init(PyInterpreterState *interp, PyObject *sysmod)
|
|||
if (Py_VerboseFlag) {
|
||||
PySys_FormatStderr("import sys # builtin\n");
|
||||
}
|
||||
if (PyDict_SetItemString(sys_modules, "imp", impmod) < 0) {
|
||||
Py_FatalError("Py_Initialize: can't save imp to sys.modules");
|
||||
if (PyDict_SetItemString(sys_modules, "_imp", impmod) < 0) {
|
||||
Py_FatalError("Py_Initialize: can't save _imp to sys.modules");
|
||||
}
|
||||
|
||||
value = PyObject_CallMethod(importlib, "_setup", "OO", sysmod, impmod);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue