if FileIO.__init__ fails, close fd
This commit is contained in:
parent
430d469758
commit
bbb0412ad1
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue