mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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>
This commit is contained in:
parent
e0bcfd0e4d
commit
204946986f
21 changed files with 56 additions and 36 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue