Skip to content

gh-110266: Fix "get_module_from_owned_type is unused" warning #110269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Modules/_testinternalcapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
12 changes: 2 additions & 10 deletions Modules/_xxinterpchannelsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down Expand Up @@ -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);
}
Expand Down