summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2017-09-04 23:54:09 (GMT)
committerGitHub <noreply@github.com>2017-09-04 23:54:09 (GMT)
commit86b7afdfeee77993fe896a2aa13b3f4f95973f16 (patch)
treea37fbb7233319c671e4787bff683629148cab971 /Python/sysmodule.c
parentf5ea83f4864232fecc042ff0d1c2401807b19280 (diff)
downloadcpython-86b7afdfeee77993fe896a2aa13b3f4f95973f16.zip
cpython-86b7afdfeee77993fe896a2aa13b3f4f95973f16.tar.gz
cpython-86b7afdfeee77993fe896a2aa13b3f4f95973f16.tar.bz2
bpo-28411: Remove "modules" field from Py_InterpreterState. (#1638)
sys.modules is the one true source.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index ab435c8..852babb 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -159,13 +159,11 @@ static PyObject *
sys_displayhook(PyObject *self, PyObject *o)
{
PyObject *outf;
- PyInterpreterState *interp = PyThreadState_GET()->interp;
- PyObject *modules = interp->modules;
PyObject *builtins;
static PyObject *newline = NULL;
int err;
- builtins = _PyDict_GetItemId(modules, &PyId_builtins);
+ builtins = _PyImport_GetModuleId(&PyId_builtins);
if (builtins == NULL) {
PyErr_SetString(PyExc_RuntimeError, "lost builtins module");
return NULL;
@@ -1929,7 +1927,7 @@ _PySys_BeginInit(void)
PyObject *m, *sysdict, *version_info;
int res;
- m = PyModule_Create(&sysmodule);
+ m = _PyModule_CreateInitialized(&sysmodule, PYTHON_API_VERSION);
if (m == NULL)
return NULL;
sysdict = PyModule_GetDict(m);