summaryrefslogtreecommitdiffstats
path: root/Modules/cjkcodecs/cjkcodecs.h
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/cjkcodecs/cjkcodecs.h')
-rw-r--r--Modules/cjkcodecs/cjkcodecs.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/Modules/cjkcodecs/cjkcodecs.h b/Modules/cjkcodecs/cjkcodecs.h
index ee58878..766f829 100644
--- a/Modules/cjkcodecs/cjkcodecs.h
+++ b/Modules/cjkcodecs/cjkcodecs.h
@@ -398,11 +398,7 @@ register_maps(PyObject *module)
strcpy(mhname + sizeof("__map_") - 1, h->charset);
PyObject *capsule = PyCapsule_New((void *)h, MAP_CAPSULE, NULL);
- if (capsule == NULL) {
- return -1;
- }
- if (PyModule_AddObject(module, mhname, capsule) < 0) {
- Py_DECREF(capsule);
+ if (PyModule_Add(module, mhname, capsule) < 0) {
return -1;
}
}