diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-25 20:47:16 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-25 20:47:16 (GMT) |
commit | a80987f20d0c73532127e1c3f69f7983c5c443d2 (patch) | |
tree | 7747598f8d947aada125c326de1940792ae69d39 /Modules | |
parent | b79f28ccbd0cde0580a8d7198ac62e97e7cfb4c4 (diff) | |
download | cpython-a80987f20d0c73532127e1c3f69f7983c5c443d2.zip cpython-a80987f20d0c73532127e1c3f69f7983c5c443d2.tar.gz cpython-a80987f20d0c73532127e1c3f69f7983c5c443d2.tar.bz2 |
Issue #12175: RawIOBase.readall() now returns None if read() returns None.
Diffstat (limited to 'Modules')
-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 84b560a..316321a 100644 --- a/Modules/_io/iobase.c +++ b/Modules/_io/iobase.c @@ -814,6 +814,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); |