diff options
Diffstat (limited to 'Modules/_io/textio.c')
-rw-r--r-- | Modules/_io/textio.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 421dc50..fb9b674 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -1056,8 +1056,11 @@ textiowrapper_init(textio *self, PyObject *args, PyObject *kwds) res = _PyObject_CallMethodId(buffer, &PyId_seekable, NULL); if (res == NULL) goto error; - self->seekable = self->telling = PyObject_IsTrue(res); + r = PyObject_IsTrue(res); Py_DECREF(res); + if (r < 0) + goto error; + self->seekable = self->telling = r; self->has_read1 = _PyObject_HasAttrId(buffer, &PyId_read1); |