MCPcopy Create free account
hub / github.com/PRIME-RL/PRIME / WriteOnlyStringIO

Class WriteOnlyStringIO

eval/utils/execution_leetcode.py:623–637  ·  view source on GitHub ↗

StringIO that throws an exception when it's read from

Source from the content-addressed store, hash-verified

621
622
623class WriteOnlyStringIO(io.StringIO):
624 """ StringIO that throws an exception when it's read from """
625
626 def read(self, *args, **kwargs):
627 raise IOError
628
629 def readline(self, *args, **kwargs):
630 raise IOError
631
632 def readlines(self, *args, **kwargs):
633 raise IOError
634
635 def readable(self, *args, **kwargs):
636 """ Returns True if the IO object can be read. """
637 return False
638
639
640class redirect_stdin(contextlib._RedirectStream): # type: ignore

Callers 1

swallow_ioFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected