aboutsummaryrefslogtreecommitdiff
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/_sha3
parentIssue #18742: Rework the internal hashlib construtor to pave the road for ABCs. (diff)
downloadcpython-327dd732ce2b7df001b0a052e3464c85f0c85128.tar.gz
cpython-327dd732ce2b7df001b0a052e3464c85f0c85128.tar.bz2
cpython-327dd732ce2b7df001b0a052e3464c85f0c85128.zip
Issue #18742: Expose the internal hash type object for ABCs.
Diffstat (limited to 'Modules/_sha3')
-rw-r--r--Modules/_sha3/sha3module.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/Modules/_sha3/sha3module.c b/Modules/_sha3/sha3module.c
index 4e6352b7baf..71127d0b76c 100644
--- a/Modules/_sha3/sha3module.c
+++ b/Modules/_sha3/sha3module.c
@@ -576,10 +576,18 @@ static struct PyModuleDef _SHA3module = {
PyMODINIT_FUNC
PyInit__sha3(void)
{
+ PyObject *m;
+
Py_TYPE(&SHA3type) = &PyType_Type;
if (PyType_Ready(&SHA3type) < 0) {
return NULL;
}
- return PyModule_Create(&_SHA3module);
+ m = PyModule_Create(&_SHA3module);
+ if (m == NULL)
+ return NULL;
+
+ Py_INCREF((PyObject *)&SHA3type);
+ PyModule_AddObject(m, "SHA3Type", (PyObject *)&SHA3type);
+ return m;
}