diff options
Diffstat (limited to 'Modules/_io/iobase.c')
-rw-r--r-- | Modules/_io/iobase.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c index ec7a242..f06f562 100644 --- a/Modules/_io/iobase.c +++ b/Modules/_io/iobase.c @@ -815,6 +815,14 @@ rawiobase_readall(PyObject *self, PyObject *args) Py_DECREF(chunks); return NULL; } + if (data == Py_None) { + if (PyList_GET_SIZE(chunks) == 0) { + Py_DECREF(chunks); + return data; + } + Py_DECREF(data); + break; + } if (!PyBytes_Check(data)) { Py_DECREF(chunks); Py_DECREF(data); |