summaryrefslogtreecommitdiffstats
path: root/Modules/arraymodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r--Modules/arraymodule.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 0000a8d..80a9542 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -3163,9 +3163,8 @@ array_modexec(PyObject *m)
CREATE_TYPE(m, state->ArrayIterType, &arrayiter_spec);
Py_SET_TYPE(state->ArrayIterType, &PyType_Type);
- if (PyModule_AddObject(m, "ArrayType",
- Py_NewRef((PyObject *)state->ArrayType)) < 0) {
- Py_DECREF((PyObject *)state->ArrayType);
+ if (PyModule_AddObjectRef(m, "ArrayType",
+ (PyObject *)state->ArrayType) < 0) {
return -1;
}
@@ -3193,8 +3192,7 @@ array_modexec(PyObject *m)
*p++ = (char)descr->typecode;
}
typecodes = PyUnicode_DecodeASCII(buffer, p - buffer, NULL);
- if (PyModule_AddObject(m, "typecodes", typecodes) < 0) {
- Py_XDECREF(typecodes);
+ if (PyModule_Add(m, "typecodes", typecodes) < 0) {
return -1;
}