if FileIO.__init__ fails, close fd

This commit is contained in:
Benjamin Peterson 2010-10-30 23:16:28 +00:00
parent 430d469758
commit bbb0412ad1
2 changed files with 4 additions and 0 deletions

View file

@ -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);