summaryrefslogtreecommitdiffstats
path: root/Modules/_io/iobase.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_io/iobase.c')
-rw-r--r--Modules/_io/iobase.c4
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);