Yolanda added the comment: How about...
@@ -2339,9 +2339,12 @@ def mock_open(mock=None, read_data=''): if handle.readline.return_value is not None: while True: yield handle.readline.return_value - for line in _state[0]: - yield line + try: + while True: + yield next(_state[0]) + except StopIteration: + yield '' ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26807> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com