summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-25 20:51:16 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-25 20:51:16 (GMT)
commitd2780aedce824867ed14bd9a2a5ef050ae0c8d30 (patch)
treee1f7313f05fc0220b3a0911c2ba3f11429f049c8 /Modules
parentaf62c7d3deb6e6db5a0ef1190b8dd889be013a41 (diff)
parent988512cfd7c896dd8b900d0f00cba05c4c807dc3 (diff)
downloadcpython-d2780aedce824867ed14bd9a2a5ef050ae0c8d30.zip
cpython-d2780aedce824867ed14bd9a2a5ef050ae0c8d30.tar.gz
cpython-d2780aedce824867ed14bd9a2a5ef050ae0c8d30.tar.bz2
(Merge 3.2) Issue #12175: RawIOBase.readall() now returns None if read()
returns None.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_io/iobase.c8
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);