Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Check sys.modules in _PyImport_EnsureInitialized().
  • Loading branch information
ericsnowcurrently committed Sep 14, 2017
commit 26bdb7e65ca9eb481af4801c4ca7880360495e25
8 changes: 8 additions & 0 deletions Python/import.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,14 @@ _PyImport_EnsureInitialized(PyInterpreterState *interp)
{
if (interp->modules == NULL)
goto notinitialized;
/* We aren't ready to do this yet.
if (interp->sysdict == NULL)
goto notinitialized;
_Py_IDENTIFIER(modules);
PyObject *modules = _PyDict_GetItemId(interp->sysdict, &PyId_modules);
if (modules == NULL)
goto notinitialized;
*/
return;

notinitialized:
Expand Down