Merged revisions 84814 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84814 | antoine.pitrou | 2010-09-14 20:37:24 +0200 (mar., 14 sept. 2010) | 4 lines
Issue #9854: The default read() implementation in io.RawIOBase now
handles non-blocking readinto() returning None correctly.
........
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c
index 2d664ab..dfc1a3a 100644
--- a/Modules/_io/iobase.c
+++ b/Modules/_io/iobase.c
@@ -776,9 +776,9 @@
return NULL;
res = PyObject_CallMethodObjArgs(self, _PyIO_str_readinto, b, NULL);
- if (res == NULL) {
+ if (res == NULL || res == Py_None) {
Py_DECREF(b);
- return NULL;
+ return res;
}
n = PyNumber_AsSsize_t(res, PyExc_ValueError);