mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Issue #26807: mock_open 'files' no longer error on readline at end of file.
Patch from Yolanda Robla.
This commit is contained in:
parent
33a8fb9920
commit
9549a3e3d4
4 changed files with 18 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue