diff options
author | Christian Heimes <christian@cheimes.de> | 2013-10-22 15:05:23 +0200 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-10-22 15:05:23 +0200 |
commit | 327dd732ce2b7df001b0a052e3464c85f0c85128 (patch) | |
tree | 503582cbb9364f320bc9754340c7a6a2dde23e40 /Modules/md5module.c | |
parent | e53510726b337762d005984eeab0b266c60b779d (diff) | |
download | cpython-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.c | 11 |
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; } |