diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-25 20:49:15 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-25 20:49:15 (GMT) |
commit | 988512cfd7c896dd8b900d0f00cba05c4c807dc3 (patch) | |
tree | 00d1050f4d082f25471ca7b9e61aa745e29a99c8 /Modules | |
parent | 4767114e77fc68cfcd630318ec58e632b00c2e04 (diff) | |
parent | a80987f20d0c73532127e1c3f69f7983c5c443d2 (diff) | |
download | cpython-988512cfd7c896dd8b900d0f00cba05c4c807dc3.zip cpython-988512cfd7c896dd8b900d0f00cba05c4c807dc3.tar.gz cpython-988512cfd7c896dd8b900d0f00cba05c4c807dc3.tar.bz2 |
(Merge 3.1) 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 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); |