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

@ -544,8 +544,17 @@ static struct PyModuleDef _sha1module = {
PyMODINIT_FUNC
PyInit__sha1(void)
{
PyObject *m;
Py_TYPE(&SHA1type) = &PyType_Type;
if (PyType_Ready(&SHA1type) < 0)
return NULL;
return PyModule_Create(&_sha1module);
m = PyModule_Create(&_sha1module);
if (m == NULL)
return NULL;
Py_INCREF((PyObject *)&SHA1type);
PyModule_AddObject(m, "SHA1Type", (PyObject *)&SHA1type);
return m;
}