summaryrefslogtreecommitdiffstats
path: root/Modules/_io
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-25 20:47:16 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-25 20:47:16 (GMT)
commita80987f20d0c73532127e1c3f69f7983c5c443d2 (patch)
tree7747598f8d947aada125c326de1940792ae69d39 /Modules/_io
parentb79f28ccbd0cde0580a8d7198ac62e97e7cfb4c4 (diff)
downloadcpython-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/_io')
-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 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);