(self, s)
| 124 | self.fp = fp |
| 125 | self._is_safe_wrapper = True |
| 126 | def write(self, s): |
| 127 | try: |
| 128 | self.fp.write(s) |
| 129 | except (OSError, UnicodeError): |
| 130 | # OSError: EPIPE from a dead parent shell (the wrapper's original |
| 131 | # job). UnicodeError (#1155): a library print of user text hitting |
| 132 | # a non-UTF-8 stream — cp1252 stdout on Windows — must not abort |
| 133 | # the operation that printed. Logs are best-effort; work is not. |
| 134 | pass |
| 135 | def flush(self): |
| 136 | try: |
| 137 | getattr(self.fp, 'flush', lambda: None)() |