mirror of https://github.com/python/cpython.git
gh-83004: Clean up refleak in _io initialisation (GH-98840)
(cherry picked from commit 1208037246
)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
This commit is contained in:
parent
22bbb0c4c7
commit
8d44f36a4a
|
@ -0,0 +1 @@
|
|||
Clean up refleak on failed module initialisation in :mod:`_io`.
|
|
@ -718,10 +718,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;
|
||||
}
|
||||
|
||||
/* Concrete base types of the IO ABCs.
|
||||
(the ABCs themselves are declared through inheritance in io.py)
|
||||
|
|
Loading…
Reference in New Issue