Skip to content

Commit 3c46ef7

Browse files
committed
pythongh-110266: Fix "get_module_from_owned_type is unused" warning
1 parent 8c07137 commit 3c46ef7

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

Modules/_testinternalcapi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
static PyObject *
4343
_get_current_module(void)
4444
{
45+
// XXX Use the more efficient API now that we use heap types:
46+
// return PyType_GetModule(cls);
47+
4548
// We ensured it was imported in _run_script().
4649
PyObject *name = PyUnicode_FromString(MODULE_NAME);
4750
if (name == NULL) {

Modules/_xxinterpchannelsmodule.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,6 @@ _get_current_module(void)
100100
return mod;
101101
}
102102

103-
static PyObject *
104-
get_module_from_owned_type(PyTypeObject *cls)
105-
{
106-
assert(cls != NULL);
107-
return _get_current_module();
108-
// XXX Use the more efficient API now that we use heap types:
109-
//return PyType_GetModule(cls);
110-
}
111-
112103
static struct PyModuleDef moduledef;
113104

114105
static PyObject *
@@ -2464,7 +2455,8 @@ channel__channel_id(PyObject *self, PyObject *args, PyObject *kwds)
24642455
return NULL;
24652456
}
24662457
PyTypeObject *cls = state->ChannelIDType;
2467-
assert(get_module_from_owned_type(cls) == self);
2458+
assert(cls != NULL);
2459+
assert(_get_current_module() == self);
24682460

24692461
return _channelid_new(self, cls, args, kwds);
24702462
}

0 commit comments

Comments
 (0)