MCPcopy Create free account
hub / github.com/RUC-NLPIR/WebThinker / __enter__

Method __enter__

scripts/lcb_runner/evaluation/testing_util.py:58–63  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

56# alternative use redirect_stdout() from contextlib
57class Capturing(list):
58 def __enter__(self):
59 self._stdout = sys.stdout
60 sys.stdout = self._stringio = StringIO()
61 # Make closing the StringIO a no-op
62 self._stringio.close = lambda x: 1
63 return self
64
65 def __exit__(self, *args):
66 self.append(self._stringio.getvalue())

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected