mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
PEP 479: Change StopIteration handling inside generators.
Closes issue #22906.
This commit is contained in:
parent
bd60e8dece
commit
8170e8c0d1
14 changed files with 103 additions and 15 deletions
|
@ -1596,8 +1596,7 @@ def _mdiff(fromlines, tolines, context=None, linejunk=None,
|
|||
# them up without doing anything else with them.
|
||||
line_pair_iterator = _line_pair_iterator()
|
||||
if context is None:
|
||||
while True:
|
||||
yield next(line_pair_iterator)
|
||||
yield from line_pair_iterator
|
||||
# Handle case where user wants context differencing. We must do some
|
||||
# storage of lines until we know for sure that they are to be yielded.
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue