mirror of
https://github.com/python/cpython
synced 2026-09-29 09:55:31 +03:00
(Merge 3.2) Issue #12175: RawIOBase.readall() now returns None if read()
returns None.
This commit is contained in:
commit
d2780aedce
4 changed files with 28 additions and 11 deletions
|
|
@ -815,6 +815,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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue