mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
if FileIO.__init__ fails, close fd
This commit is contained in:
parent
430d469758
commit
bbb0412ad1
2 changed files with 4 additions and 0 deletions
|
@ -410,6 +410,8 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
|
|||
|
||||
error:
|
||||
ret = -1;
|
||||
if (self->fd >= 0)
|
||||
internal_close(self);
|
||||
|
||||
done:
|
||||
Py_CLEAR(stringobj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue