summaryrefslogtreecommitdiffstats
path: root/Modules/pyexpat.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 /Modules/pyexpat.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 'Modules/pyexpat.c')
-rw-r--r--Modules/pyexpat.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
index d9cfa3e..c8a01d4 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -1643,7 +1643,6 @@ MODULE_INITFUNC(void)
PyObject *errors_module;
PyObject *modelmod_name;
PyObject *model_module;
- PyObject *sys_modules;
PyObject *tmpnum, *tmpstr;
PyObject *codes_dict;
PyObject *rev_codes_dict;
@@ -1693,11 +1692,6 @@ MODULE_INITFUNC(void)
*/
PyModule_AddStringConstant(m, "native_encoding", "UTF-8");
- sys_modules = PySys_GetObject("modules");
- if (sys_modules == NULL) {
- Py_DECREF(m);
- return NULL;
- }
d = PyModule_GetDict(m);
if (d == NULL) {
Py_DECREF(m);
@@ -1707,7 +1701,7 @@ MODULE_INITFUNC(void)
if (errors_module == NULL) {
errors_module = PyModule_New(MODULE_NAME ".errors");
if (errors_module != NULL) {
- PyDict_SetItem(sys_modules, errmod_name, errors_module);
+ _PyImport_SetModule(errmod_name, errors_module);
/* gives away the reference to errors_module */
PyModule_AddObject(m, "errors", errors_module);
}
@@ -1717,7 +1711,7 @@ MODULE_INITFUNC(void)
if (model_module == NULL) {
model_module = PyModule_New(MODULE_NAME ".model");
if (model_module != NULL) {
- PyDict_SetItem(sys_modules, modelmod_name, model_module);
+ _PyImport_SetModule(modelmod_name, model_module);
/* gives away the reference to model_module */
PyModule_AddObject(m, "model", model_module);
}