mirror of https://github.com/python/cpython
bpo-43770: Cleanup PyModuleDef_Init() (GH-26879)
PyModuleDef_Init() no longer tries to make PyModule_Type type: it's already done by _PyTypes_Init() at Python startup. Replace PyType_Ready() call with an assertion.
This commit is contained in:
parent
a50e28377b
commit
2a396d65b8
|
@ -46,8 +46,7 @@ _PyModule_IsExtension(PyObject *obj)
|
|||
PyObject*
|
||||
PyModuleDef_Init(struct PyModuleDef* def)
|
||||
{
|
||||
if (PyType_Ready(&PyModuleDef_Type) < 0)
|
||||
return NULL;
|
||||
assert(PyModuleDef_Type.tp_flags & Py_TPFLAGS_READY);
|
||||
if (def->m_base.m_index == 0) {
|
||||
max_module_number++;
|
||||
Py_SET_REFCNT(def, 1);
|
||||
|
|
Loading…
Reference in New Issue