Skip to content

Commit

Permalink
gh-83004: Clean up refleak in _io initialisation (#98840)
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja authored Nov 3, 2022
1 parent 8c4de57 commit 1208037
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clean up refleak on failed module initialisation in :mod:`_io`.
6 changes: 3 additions & 3 deletions Modules/_io/_iomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1208037

Please sign in to comment.