MCPcopy Create free account
hub / github.com/ipython/ipython / _get_ostream

Method _get_ostream

IPython/core/ultratb.py:511–522  ·  view source on GitHub ↗

Output stream that exceptions are written to. Valid values are: - None: the default, which means that IPython will dynamically resolve to sys.stdout. This ensures compatibility with most tools, including Windows (where plain stdout doesn't recognize ANSI escape

(self)

Source from the content-addressed store, hash-verified

509 self.pdb = None
510
511 def _get_ostream(self):
512 """Output stream that exceptions are written to.
513
514 Valid values are:
515
516 - None: the default, which means that IPython will dynamically resolve
517 to sys.stdout. This ensures compatibility with most tools, including
518 Windows (where plain stdout doesn't recognize ANSI escapes).
519
520 - Any object with 'write' and 'flush' attributes.
521 """
522 return sys.stdout if self._ostream is None else self._ostream
523
524 def _set_ostream(self, val):
525 assert val is None or (hasattr(val, 'write') and hasattr(val, 'flush'))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected