diff options
author | Guido van Rossum <guido@python.org> | 2007-07-10 12:00:45 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-07-10 12:00:45 (GMT) |
commit | 469734b996915d2257639a671715539ad42e2576 (patch) | |
tree | a96f42f66959e129766ca4c61e36a5912b98ea97 /Lib/io.py | |
parent | 47f17d01751f0b8186d6e08f4019f5b1bacf9512 (diff) | |
download | cpython-469734b996915d2257639a671715539ad42e2576.zip cpython-469734b996915d2257639a671715539ad42e2576.tar.gz cpython-469734b996915d2257639a671715539ad42e2576.tar.bz2 |
Set closed flag *after* calling flush().
Diffstat (limited to 'Lib/io.py')
-rw-r--r-- | Lib/io.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -227,8 +227,10 @@ class IOBase: 'closed' property (see below) to test. """ if not self.__closed: - self.__closed = True - self.flush() + try: + self.flush() + finally: + self.__closed = True def __del__(self) -> None: """Destructor. Calls close().""" |