Skip to content

Commit c3dfade

Browse files
author
Erlend E. Aasland
committed
Use PyModule_AddType()
1 parent a5798e2 commit c3dfade

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Modules/arraymodule.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3005,9 +3005,7 @@ array_modexec(PyObject *m)
30053005
}
30063006
Py_DECREF(res);
30073007

3008-
Py_INCREF((PyObject *)state->ArrayType);
3009-
if (PyModule_AddObject(m, "array", (PyObject *)state->ArrayType) < 0) {
3010-
Py_DECREF((PyObject *)state->ArrayType);
3008+
if (PyModule_AddType(m, state->ArrayType) < 0) {
30113009
return -1;
30123010
}
30133011

0 commit comments

Comments
 (0)