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

Class WriteOnlyStringIO

scripts/lcb_runner/evaluation/utils_execute.py:153–167  ·  view source on GitHub ↗

StringIO that throws an exception when it's read from

Source from the content-addressed store, hash-verified

151
152
153class WriteOnlyStringIO(io.StringIO):
154 """StringIO that throws an exception when it's read from"""
155
156 def read(self, *args, **kwargs):
157 raise OSError
158
159 def readline(self, *args, **kwargs):
160 raise OSError
161
162 def readlines(self, *args, **kwargs):
163 raise OSError
164
165 def readable(self, *args, **kwargs):
166 """Returns True if the IO object can be read."""
167 return False
168
169
170class redirect_stdin(contextlib._RedirectStream): # type: ignore

Callers 1

swallow_ioFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected