]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Remove unused internal _PyImport_GetModuleId() function (#107235)
authorVictor Stinner <vstinner@python.org>
Tue, 25 Jul 2023 17:02:12 +0000 (19:02 +0200)
committerGitHub <noreply@github.com>
Tue, 25 Jul 2023 17:02:12 +0000 (17:02 +0000)
Include/internal/pycore_import.h
Python/import.c

index c12ef7cebadc2d328556f14fd94e0ff3ebf19ddb..f61f0af6bb263d91c37492582ff553e07ebe2614 100644 (file)
@@ -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);
 
index cf993cbd62a2efb109f6a606f990862908f6ddb9..f8cae641a645416f7538c0664e5004fa66b5a41b 100644 (file)
@@ -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)
 {