diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-11-03 14:58:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-03 14:58:44 (GMT) |
commit | 8d44f36a4ad856ceefb671724b48e48f65d81ee9 (patch) | |
tree | c9f2a3e27edc945316ee0f459bd599b59b091f6c /Modules/_io/_iomodule.c | |
parent | 22bbb0c4c7ba4cfddea3f4cec03f50be34479516 (diff) | |
download | cpython-8d44f36a4ad856ceefb671724b48e48f65d81ee9.zip cpython-8d44f36a4ad856ceefb671724b48e48f65d81ee9.tar.gz cpython-8d44f36a4ad856ceefb671724b48e48f65d81ee9.tar.bz2 |
gh-83004: Clean up refleak in _io initialisation (GH-98840)
(cherry picked from commit 1208037246eeab4c5c003f1651edfefb045e6fb7)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Diffstat (limited to 'Modules/_io/_iomodule.c')
-rw-r--r-- | Modules/_io/_iomodule.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index 170dea4..9e53de5 100644 --- a/Modules/_io/_iomodule.c +++ b/Modules/_io/_iomodule.c @@ -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) |