Issue #26807: mock_open 'files' no longer error on readline at end of file.

Patch from Yolanda Robla.
This commit is contained in:
Robert Collins 2016-05-16 15:22:01 +12:00
parent 33a8fb9920
commit 9549a3e3d4
4 changed files with 18 additions and 0 deletions

View file

@ -2323,6 +2323,8 @@ def mock_open(mock=None, read_data=''):
yield handle.readline.return_value
for line in _state[0]:
yield line
while True:
yield type(read_data)()
global file_spec