MCPcopy Create free account
hub / github.com/GAIR-NLP/factool / WriteOnlyStringIO

Class WriteOnlyStringIO

factool/code/helper/_execution.py:142–156  ·  view source on GitHub ↗

StringIO that throws an exception when it's read from

Source from the content-addressed store, hash-verified

140
141
142class WriteOnlyStringIO(io.StringIO):
143 """ StringIO that throws an exception when it's read from """
144
145 def read(self, *args, **kwargs):
146 raise IOError
147
148 def readline(self, *args, **kwargs):
149 raise IOError
150
151 def readlines(self, *args, **kwargs):
152 raise IOError
153
154 def readable(self, *args, **kwargs):
155 """ Returns True if the IO object can be read. """
156 return False
157
158
159class redirect_stdin(contextlib._RedirectStream): # type: ignore

Callers 1

swallow_ioFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected