Make stdin iterable in debug mode in Python 3 (PY-24110)

This commit is contained in:
Semyon Proshev
2017-11-24 16:12:50 +03:00
parent 86ce6d260c
commit 1e35739676
@@ -93,6 +93,10 @@ class BaseStdIn:
def close(self, *args, **kwargs):
pass # expected in StdIn
def __iter__(self):
# BaseStdIn would not be considered as Iterable in Python 3 without explicit `__iter__` implementation
return self.original_stdin.__iter__()
def __getattr__(self, item):
# it's called if the attribute wasn't found
if hasattr(self.original_stdin, item):