mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Fix use of uninitialized scalar variable, see 3f994367a979
CID 1058763
This commit is contained in:
parent
49e52f9375
commit
72f455e96c
1 changed files with 3 additions and 1 deletions
|
|
@ -210,8 +210,10 @@ iobase_finalize(PyObject *self)
|
|||
/* If `closed` doesn't exist or can't be evaluated as bool, then the
|
||||
object is probably in an unusable state, so ignore. */
|
||||
res = PyObject_GetAttr(self, _PyIO_str_closed);
|
||||
if (res == NULL)
|
||||
if (res == NULL) {
|
||||
PyErr_Clear();
|
||||
closed = -1;
|
||||
}
|
||||
else {
|
||||
closed = PyObject_IsTrue(res);
|
||||
Py_DECREF(res);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue