MCPcopy Index your code
hub / github.com/ipython/ipython / __enter__

Method __enter__

IPython/testing/tools.py:330–334  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

328 self.suppress = suppress
329
330 def __enter__(self):
331 self.orig_stream = getattr(sys, self.channel)
332 self.buffer = MyStringIO()
333 self.tee = Tee(self.buffer, channel=self.channel)
334 setattr(sys, self.channel, self.buffer if self.suppress else self.tee)
335
336 def __exit__(self, etype: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]):
337 __tracebackhide__ = True

Callers

nothing calls this directly

Calls 1

TeeClass · 0.90

Tested by

no test coverage detected