R. David Murray <[email protected]> added the comment:
Given your problem report wouldn't the simplest solution be to change the close
method to be:
if hasattr(self, '_file'):
if hasattr(self._file, 'close'):
self._file.close()
del self._file
As for a test, it seems to me that adding a test to the appropriate existing
cases that calls get_file and then closes the returned object twice should be
sufficient.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue11700>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com