Issue #18742: Expose the internal hash type object for ABCs.

This commit is contained in:
Christian Heimes 2013-10-22 15:05:23 +02:00
parent e53510726b
commit 327dd732ce
6 changed files with 55 additions and 8 deletions

View file

@ -572,8 +572,17 @@ static struct PyModuleDef _md5module = {
PyMODINIT_FUNC
PyInit__md5(void)
{
PyObject *m;
Py_TYPE(&MD5type) = &PyType_Type;
if (PyType_Ready(&MD5type) < 0)
return NULL;
return PyModule_Create(&_md5module);
m = PyModule_Create(&_md5module);
if (m == NULL)
return NULL;
Py_INCREF((PyObject *)&MD5type);
PyModule_AddObject(m, "MD5Type", (PyObject *)&MD5type);
return m;
}