diff options
Diffstat (limited to 'Lib/_pyio.py')
-rw-r--r-- | Lib/_pyio.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 09aa78d..3ed02e4 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -1230,8 +1230,10 @@ class BufferedRWPair(BufferedIOBase): return self.writer.flush() def close(self): - self.writer.close() - self.reader.close() + try: + self.writer.close() + finally: + self.reader.close() def isatty(self): return self.reader.isatty() or self.writer.isatty() |