diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c index 05bac0936b155d..23f27f6d2b3f76 100644 --- a/Modules/_testinternalcapi.c +++ b/Modules/_testinternalcapi.c @@ -42,6 +42,9 @@ static PyObject * _get_current_module(void) { + // XXX Use the more efficient API now that we use heap types: + // return PyType_GetModule(cls); + // We ensured it was imported in _run_script(). PyObject *name = PyUnicode_FromString(MODULE_NAME); if (name == NULL) { diff --git a/Modules/_xxinterpchannelsmodule.c b/Modules/_xxinterpchannelsmodule.c index d5be76f1f0e38e..e1524766376f91 100644 --- a/Modules/_xxinterpchannelsmodule.c +++ b/Modules/_xxinterpchannelsmodule.c @@ -100,15 +100,6 @@ _get_current_module(void) return mod; } -static PyObject * -get_module_from_owned_type(PyTypeObject *cls) -{ - assert(cls != NULL); - return _get_current_module(); - // XXX Use the more efficient API now that we use heap types: - //return PyType_GetModule(cls); -} - static struct PyModuleDef moduledef; static PyObject * @@ -2464,7 +2455,8 @@ channel__channel_id(PyObject *self, PyObject *args, PyObject *kwds) return NULL; } PyTypeObject *cls = state->ChannelIDType; - assert(get_module_from_owned_type(cls) == self); + assert(cls != NULL); + assert(_get_current_module() == self); return _channelid_new(self, cls, args, kwds); }