Close the file and restore the channel.
(self)
| 132 | self._closed = False |
| 133 | |
| 134 | def close(self): |
| 135 | """Close the file and restore the channel.""" |
| 136 | self.flush() |
| 137 | setattr(sys, self.channel, self.ostream) |
| 138 | self.file.close() |
| 139 | self._closed = True |
| 140 | |
| 141 | def write(self, data): |
| 142 | """Write data to both channels.""" |