Close the file and restore the channel.
(self)
| 57 | self._closed = False |
| 58 | |
| 59 | def close(self): |
| 60 | """Close the file and restore the channel.""" |
| 61 | self.flush() |
| 62 | setattr(sys, self.channel, self.ostream) |
| 63 | self.file.close() |
| 64 | self._closed = True |
| 65 | |
| 66 | def write(self, data): |
| 67 | """Write data to both channels.""" |