| 488 | stacklevel=2) |
| 489 | |
| 490 | def init_io(self): |
| 491 | if sys.platform not in {'win32', 'cli'}: |
| 492 | return |
| 493 | |
| 494 | import colorama |
| 495 | colorama.init() |
| 496 | |
| 497 | # For some reason we make these wrappers around stdout/stderr. |
| 498 | # For now, we need to reset them so all output gets coloured. |
| 499 | # https://github.com/ipython/ipython/issues/8669 |
| 500 | # io.std* are deprecated, but don't show our own deprecation warnings |
| 501 | # during initialization of the deprecated API. |
| 502 | with warnings.catch_warnings(): |
| 503 | warnings.simplefilter('ignore', DeprecationWarning) |
| 504 | io.stdout = io.IOStream(sys.stdout) |
| 505 | io.stderr = io.IOStream(sys.stderr) |
| 506 | |
| 507 | def init_magics(self): |
| 508 | super(TerminalInteractiveShell, self).init_magics() |