Commit bbb0412a authored by Benjamin Peterson's avatar Benjamin Peterson

if FileIO.__init__ fails, close fd

parent 430d4697
......@@ -10,6 +10,8 @@ What's New in Python 3.2 Beta 1?
Core and Builtins
-----------------
- If FileIO.__init__ fails, close the file descriptor.
- Issue #10221: dict.pop(k) now has a key error message that includes the
missing key (same message d[k] returns for missing keys).
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment