commit | a80987f20d0c73532127e1c3f69f7983c5c443d2 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@haypocalc.com> | Wed May 25 22:47:16 2011 +0200 |
committer | Victor Stinner <victor.stinner@haypocalc.com> | Wed May 25 22:47:16 2011 +0200 |
tree | 7747598f8d947aada125c326de1940792ae69d39 | |
parent | b79f28ccbd0cde0580a8d7198ac62e97e7cfb4c4 [diff] [blame] |
Issue #12175: RawIOBase.readall() now returns None if read() returns None.
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 @@ 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);