summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-11-06 14:03:52 (GMT)
committerGitHub <noreply@github.com>2022-11-06 14:03:52 (GMT)
commit29c3dc050a4a5e458be7a8966c028bf07502c4b6 (patch)
tree380d65ebe815fe66a86c6bc084395e4340d272e4 /Modules
parentd025046ef5867ccf47b2e0dad7dee07b277c38b1 (diff)
downloadcpython-29c3dc050a4a5e458be7a8966c028bf07502c4b6.zip
cpython-29c3dc050a4a5e458be7a8966c028bf07502c4b6.tar.gz
cpython-29c3dc050a4a5e458be7a8966c028bf07502c4b6.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')
-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 38ef246..a7b2e98 100644
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -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;