summaryrefslogtreecommitdiffstats
path: root/Objects/moduleobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/moduleobject.c')
-rw-r--r--Objects/moduleobject.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index 5fad447..2156ca0 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -173,7 +173,7 @@ _add_methods_to_object(PyObject *module, PyObject *name, PyMethodDef *functions)
PyObject *
PyModule_Create2(struct PyModuleDef* module, int module_api_version)
{
- if (!_PyImport_IsInitialized(PyThreadState_GET()->interp))
+ if (!_PyImport_IsInitialized(_PyInterpreterState_Get()))
Py_FatalError("Python import machinery not initialized");
return _PyModule_CreateInitialized(module, module_api_version);
}
@@ -693,8 +693,7 @@ module_dealloc(PyModuleObject *m)
static PyObject *
module_repr(PyModuleObject *m)
{
- PyThreadState *tstate = PyThreadState_GET();
- PyInterpreterState *interp = tstate->interp;
+ PyInterpreterState *interp = _PyInterpreterState_Get();
return PyObject_CallMethod(interp->importlib, "_module_repr", "O", m);
}