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 50abf22 commit aa5bbfaCopy full SHA for aa5bbfa
1 file changed
Modules/_io/iobase.c
@@ -186,11 +186,16 @@ iobase_close(PyObject *self, PyObject *args)
186
Py_RETURN_NONE;
187
188
res = PyObject_CallMethodObjArgs(self, _PyIO_str_flush, NULL);
189
- _PyObject_SetAttrId(self, &PyId___IOBase_closed, Py_True);
190
- if (res == NULL) {
+
+ if (_PyObject_SetAttrId(self, &PyId___IOBase_closed, Py_True) < 0) {
191
+ Py_XDECREF(res);
192
return NULL;
193
}
- Py_XDECREF(res);
194
195
+ if (res == NULL)
196
+ return NULL;
197
198
+ Py_DECREF(res);
199
200
201
0 commit comments