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