Florent Xicluna <florent.xicl...@gmail.com> added the comment:

Ɓukasz,

_closing is not necessary on FileIO instances. The class already declares an 
__exit__ method which takes care of closing file.

>>> import io
>>> f = io.FileIO('/tmp/test_closing', 'wb')
>>> f.closed
False

>>> f.__exit__()
>>> f.closed
True

Since both IOError and OSError are direct subclasses of EnvironmentError, we 
can use this in the except clause.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9572>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to