mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #15604: Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
This commit is contained in:
parent
dd7c55250d
commit
6f430e4963
11 changed files with 87 additions and 39 deletions
|
@ -1046,8 +1046,11 @@ textiowrapper_init(textio *self, PyObject *args, PyObject *kwds)
|
|||
res = PyObject_CallMethod(buffer, "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_HasAttrString(buffer, "read1");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue