From: Victor Stinner Date: Tue, 25 Jul 2023 17:02:12 +0000 (+0200) Subject: Remove unused internal _PyImport_GetModuleId() function (#107235) X-Git-Tag: v3.13.0a1~1212 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=188000ae4b486cfffaeaa0a06902e4844d1b2bbc;p=thirdparty%2FPython%2Fcpython.git Remove unused internal _PyImport_GetModuleId() function (#107235) --- diff --git a/Include/internal/pycore_import.h b/Include/internal/pycore_import.h index c12ef7cebadc..f61f0af6bb26 100644 --- a/Include/internal/pycore_import.h +++ b/Include/internal/pycore_import.h @@ -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); diff --git a/Python/import.c b/Python/import.c index cf993cbd62a2..f8cae641a645 100644 --- a/Python/import.c +++ b/Python/import.c @@ -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) {