diff options
Diffstat (limited to 'Modules/_io/bufferedio.c')
-rw-r--r-- | Modules/_io/bufferedio.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index b81abde..2b7aaaf 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -1541,7 +1541,9 @@ _bufferedreader_read_all(buffered *self) } _bufferedreader_reset_buf(self); - readall = _PyObject_GetAttrWithoutError(self->raw, _PyIO_str_readall); + if (_PyObject_LookupAttr(self->raw, _PyIO_str_readall, &readall) < 0) { + goto cleanup; + } if (readall) { tmp = _PyObject_CallNoArg(readall); Py_DECREF(readall); @@ -1561,9 +1563,6 @@ _bufferedreader_read_all(buffered *self) } goto cleanup; } - else if (PyErr_Occurred()) { - goto cleanup; - } chunks = PyList_New(0); if (chunks == NULL) |