diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-14 18:37:24 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-14 18:37:24 (GMT) |
commit | 328ec7455f11f14cb4bf7077c6a4fa48b2356433 (patch) | |
tree | 283338f8069ce73208fc79f2d66bf7a337a60e17 /Modules/_io | |
parent | 9e0b864ac07ab85b618ccf3831eae97b2c91fb2e (diff) | |
download | cpython-328ec7455f11f14cb4bf7077c6a4fa48b2356433.zip cpython-328ec7455f11f14cb4bf7077c6a4fa48b2356433.tar.gz cpython-328ec7455f11f14cb4bf7077c6a4fa48b2356433.tar.bz2 |
Issue #9854: The default read() implementation in io.RawIOBase now
handles non-blocking readinto() returning None correctly.
Diffstat (limited to 'Modules/_io')
-rw-r--r-- | Modules/_io/iobase.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c index c74672d..9b58137 100644 --- a/Modules/_io/iobase.c +++ b/Modules/_io/iobase.c @@ -777,9 +777,9 @@ rawiobase_read(PyObject *self, PyObject *args) 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); |