mirror of https://github.com/python/cpython
gh-83004: Clean up refleak in _io initialisation (#98840)
This commit is contained in:
parent
8c4de57de9
commit
1208037246
|
@ -0,0 +1 @@
|
|||
Clean up refleak on failed module initialisation in :mod:`_io`.
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue