Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2f27d32e
Commit
2f27d32e
authored
Sep 18, 2015
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #25160: Fix import_init() comments and messages
import_init() imports the "_imp" module, not the "imp" module.
parent
4690a094
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Python/pylifecycle.c
Python/pylifecycle.c
+4
-3
No files found.
Python/pylifecycle.c
View file @
2f27d32e
...
...
@@ -252,13 +252,13 @@ import_init(PyInterpreterState *interp, PyObject *sysmod)
interp
->
importlib
=
importlib
;
Py_INCREF
(
interp
->
importlib
);
/* I
nstall _importlib as __import__
*/
/* I
mport the _imp module
*/
impmod
=
PyInit_imp
();
if
(
impmod
==
NULL
)
{
Py_FatalError
(
"Py_Initialize: can't import imp"
);
Py_FatalError
(
"Py_Initialize: can't import
_
imp"
);
}
else
if
(
Py_VerboseFlag
)
{
PySys_FormatStderr
(
"import imp # builtin
\n
"
);
PySys_FormatStderr
(
"import
_
imp # builtin
\n
"
);
}
sys_modules
=
PyImport_GetModuleDict
();
if
(
Py_VerboseFlag
)
{
...
...
@@ -268,6 +268,7 @@ import_init(PyInterpreterState *interp, PyObject *sysmod)
Py_FatalError
(
"Py_Initialize: can't save _imp to sys.modules"
);
}
/* Install importlib as the implementation of import */
value
=
PyObject_CallMethod
(
importlib
,
"_install"
,
"OO"
,
sysmod
,
impmod
);
if
(
value
==
NULL
)
{
PyErr_Print
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment