diff options
author | Petr Viktorin <encukou@gmail.com> | 2022-02-11 16:22:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-11 16:22:11 (GMT) |
commit | 204946986feee7bc80b233350377d24d20fcb1b8 (patch) | |
tree | e66ab16090f97845e0f95f981c720954e244d102 /Objects/typeobject.c | |
parent | e0bcfd0e4db193743d4bafc48d10f15ae9ed7b2b (diff) | |
download | cpython-204946986feee7bc80b233350377d24d20fcb1b8.zip cpython-204946986feee7bc80b233350377d24d20fcb1b8.tar.gz cpython-204946986feee7bc80b233350377d24d20fcb1b8.tar.bz2 |
bpo-46613: Add PyType_GetModuleByDef to the public API (GH-31081)
* Make PyType_GetModuleByDef public (remove underscore)
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Objects/typeobject.c')
-rw-r--r-- | Objects/typeobject.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index ef3549c..3f8f36a 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -3714,13 +3714,9 @@ PyType_GetModuleState(PyTypeObject *type) /* Get the module of the first superclass where the module has the * given PyModuleDef. - * Implemented by walking the MRO, is relatively slow. - * - * This is internal API for experimentation within stdlib. Discussion: - * https://mail.python.org/archives/list/capi-sig@python.org/thread/T3P2QNLNLBRFHWSKYSTPMVEIL2EEKFJU/ */ PyObject * -_PyType_GetModuleByDef(PyTypeObject *type, struct PyModuleDef *def) +PyType_GetModuleByDef(PyTypeObject *type, struct PyModuleDef *def) { assert(PyType_Check(type)); @@ -3749,7 +3745,7 @@ _PyType_GetModuleByDef(PyTypeObject *type, struct PyModuleDef *def) PyErr_Format( PyExc_TypeError, - "_PyType_GetModuleByDef: No superclass of '%s' has the given module", + "PyType_GetModuleByDef: No superclass of '%s' has the given module", type->tp_name); return NULL; } |