Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49e52f9 commit 72f455eCopy full SHA for 72f455e
1 file changed
Modules/_io/iobase.c
@@ -210,8 +210,10 @@ iobase_finalize(PyObject *self)
210
/* If `closed` doesn't exist or can't be evaluated as bool, then the
211
object is probably in an unusable state, so ignore. */
212
res = PyObject_GetAttr(self, _PyIO_str_closed);
213
- if (res == NULL)
+ if (res == NULL) {
214
PyErr_Clear();
215
+ closed = -1;
216
+ }
217
else {
218
closed = PyObject_IsTrue(res);
219
Py_DECREF(res);
0 commit comments