Skip to content

Commit 1ac9096

Browse files
committed
Release the reference before throwing the exception.
1 parent dbd807d commit 1ac9096

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Modules/_io/textio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,7 @@ _io_TextIOWrapper_read_impl(textio *self, Py_ssize_t n)
19931993
goto fail;
19941994

19951995
if (bytes == Py_None){
1996+
Py_DECREF(bytes);
19961997
PyErr_SetString(PyExc_BlockingIOError, "Read returned None.");
19971998
return NULL;
19981999

0 commit comments

Comments
 (0)