MCPcopy Index your code
hub / github.com/evalplus/evalplus / WriteOnlyStringIO

Class WriteOnlyStringIO

evalplus/eval/utils.py:81–95  ·  view source on GitHub ↗

StringIO that throws an exception when it's read from

Source from the content-addressed store, hash-verified

79
80
81class WriteOnlyStringIO(io.StringIO):
82 """StringIO that throws an exception when it's read from"""
83
84 def read(self, *args, **kwargs):
85 raise IOError
86
87 def readline(self, *args, **kwargs):
88 raise IOError
89
90 def readlines(self, *args, **kwargs):
91 raise IOError
92
93 def readable(self, *args, **kwargs):
94 """Returns True if the IO object can be read."""
95 return False
96
97
98class redirect_stdin(contextlib._RedirectStream): # type: ignore

Callers 1

swallow_ioFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected