summaryrefslogtreecommitdiff
path: root/src/hash_template.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hash_template.c')
-rw-r--r--src/hash_template.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hash_template.c b/src/hash_template.c
index eb98224..1134942 100644
--- a/src/hash_template.c
+++ b/src/hash_template.c
@@ -323,7 +323,6 @@ _MODULE_NAME (void)
PyObject *m;
#ifdef IS_PY3K
- /* PyType_Ready automatically fills in ob_type with &PyType_Type if it's not already set */
if (PyType_Ready(&ALGtype) < 0)
return NULL;
@@ -332,7 +331,9 @@ _MODULE_NAME (void)
if (m == NULL)
return NULL;
#else
- ALGtype.ob_type = &PyType_Type;
+ if (PyType_Ready(&ALGtype) < 0)
+ return;
+
m = Py_InitModule3("Crypto.Hash." _MODULE_STRING, ALG_functions, MODULE__doc__);
#endif