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

Method __enter__

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

Source from the content-addressed store, hash-verified

356 self.suppress = suppress
357
358 def __enter__(self):
359 self.orig_stream = getattr(sys, self.channel)
360 self.buffer = MyStringIO()
361 self.tee = Tee(self.buffer, channel=self.channel)
362 setattr(sys, self.channel, self.buffer if self.suppress else self.tee)
363
364 def __exit__(self, etype, value, traceback):
365 try:

Callers

nothing calls this directly

Calls 1

TeeClass · 0.90

Tested by

no test coverage detected