summaryrefslogtreecommitdiff
path: root/src/block_template.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/block_template.c')
-rw-r--r--src/block_template.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/block_template.c b/src/block_template.c
index c2c711f..d5e68c1 100644
--- a/src/block_template.c
+++ b/src/block_template.c
@@ -757,7 +757,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;
@@ -766,7 +765,9 @@ _MODULE_NAME (void)
if (m == NULL)
return NULL;
#else
- ALGtype.ob_type = &PyType_Type;
+ if (PyType_Ready(&ALGtype) < 0)
+ return;
+
/* Create the module and add the functions */
m = Py_InitModule("Crypto.Cipher." _MODULE_STRING, modulemethods);
#endif