PEP 479: Change StopIteration handling inside generators.

Closes issue #22906.
This commit is contained in:
Yury Selivanov 2015-05-09 11:44:30 -04:00
parent bd60e8dece
commit 8170e8c0d1
14 changed files with 103 additions and 15 deletions

View file

@ -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: