Skip to content

Commit

Permalink
Remove unused internal _PyImport_GetModuleId() function (python#107235)
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner authored Jul 25, 2023
1 parent 1c8fe9b commit 188000a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
1 change: 0 additions & 1 deletion Include/internal/pycore_import.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ extern "C" {

extern int _PyImport_IsInitialized(PyInterpreterState *);

extern PyObject* _PyImport_GetModuleId(_Py_Identifier *name);
PyAPI_FUNC(int) _PyImport_SetModule(PyObject *name, PyObject *module);
extern int _PyImport_SetModuleString(const char *name, PyObject* module);

Expand Down
11 changes: 0 additions & 11 deletions Python/import.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,17 +210,6 @@ PyImport_GetModuleDict(void)
return MODULES(interp);
}

// This is only kept around for extensions that use _Py_IDENTIFIER.
PyObject *
_PyImport_GetModuleId(_Py_Identifier *nameid)
{
PyObject *name = _PyUnicode_FromId(nameid); /* borrowed */
if (name == NULL) {
return NULL;
}
return PyImport_GetModule(name);
}

int
_PyImport_SetModule(PyObject *name, PyObject *m)
{
Expand Down

0 comments on commit 188000a

Please sign in to comment.