mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #18742: Expose the internal hash type object for ABCs.
This commit is contained in:
parent
e53510726b
commit
327dd732ce
6 changed files with 55 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue