summaryrefslogtreecommitdiffstats
path: root/Modules/_io/_iomodule.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-11-03 14:58:44 (GMT)
committerGitHub <noreply@github.com>2022-11-03 14:58:44 (GMT)
commit8d44f36a4ad856ceefb671724b48e48f65d81ee9 (patch)
treec9f2a3e27edc945316ee0f459bd599b59b091f6c /Modules/_io/_iomodule.c
parent22bbb0c4c7ba4cfddea3f4cec03f50be34479516 (diff)
downloadcpython-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.c6
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)