Allow DontReadFromInput to produce iterator without error. Fixes #3314.

This commit is contained in:
Jason R. Coombs
2018-03-15 21:26:40 -04:00
parent 3c3fc3bb9d
commit 2f47624b19

View File

@@ -574,7 +574,10 @@ class DontReadFromInput(object):
raise IOError("reading from stdin while output is captured")
readline = read
readlines = read
__iter__ = read
__next__ = read
def __iter__(self):
return self
def fileno(self):
raise UnsupportedOperation("redirected stdin is pseudofile, "