summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_io/_iomodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c
index 38ef246..a7b2e98 100644
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -703,10 +703,10 @@ PyInit__io(void)
goto fail;
/* BlockingIOError, for compatibility */
- Py_INCREF(PyExc_BlockingIOError);
- if (PyModule_AddObject(m, "BlockingIOError",
- (PyObject *) PyExc_BlockingIOError) < 0)
+ if (PyModule_AddObjectRef(m, "BlockingIOError",
+ (PyObject *) PyExc_BlockingIOError) < 0) {
goto fail;
+ }
// Set type base classes
PyFileIO_Type.tp_base = &PyRawIOBase_Type;