summaryrefslogtreecommitdiffstats
path: root/Modules/sha1module.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/sha1module.c')
-rw-r--r--Modules/sha1module.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/Modules/sha1module.c b/Modules/sha1module.c
index ef8e067..3fd5312 100644
--- a/Modules/sha1module.c
+++ b/Modules/sha1module.c
@@ -357,16 +357,9 @@ _sha1_exec(PyObject *module)
st->sha1_type = (PyTypeObject *)PyType_FromModuleAndSpec(
module, &sha1_type_spec, NULL);
-
- if (st->sha1_type == NULL) {
- return -1;
- }
-
- Py_INCREF(st->sha1_type);
- if (PyModule_AddObject(module,
+ if (PyModule_AddObjectRef(module,
"SHA1Type",
(PyObject *)st->sha1_type) < 0) {
- Py_DECREF(st->sha1_type);
return -1;
}