Flush written text to both stdout and a file, if open.
(self)
| 94 | self.flush() |
| 95 | |
| 96 | def flush(self) -> None: |
| 97 | """Flush written text to both stdout and a file, if open.""" |
| 98 | if self.file is not None: |
| 99 | self.file.flush() |
| 100 | |
| 101 | self.stdout.flush() |
| 102 | |
| 103 | def close(self) -> None: |
| 104 | """Flush, close possible files, and remove stdout/stderr mirroring.""" |