summaryrefslogtreecommitdiff
path: root/Modules/md5module.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-10-22 15:05:23 +0200
committerChristian Heimes <christian@cheimes.de>2013-10-22 15:05:23 +0200
commit327dd732ce2b7df001b0a052e3464c85f0c85128 (patch)
tree503582cbb9364f320bc9754340c7a6a2dde23e40 /Modules/md5module.c
parente53510726b337762d005984eeab0b266c60b779d (diff)
downloadcpython-git-327dd732ce2b7df001b0a052e3464c85f0c85128.tar.gz
Issue #18742: Expose the internal hash type object for ABCs.
Diffstat (limited to 'Modules/md5module.c')
-rw-r--r--Modules/md5module.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/Modules/md5module.c b/Modules/md5module.c
index bb91b6c369..5cb3d36c9b 100644
--- a/Modules/md5module.c
+++ b/Modules/md5module.c
@@ -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;
}