diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-05-09 11:44:30 -0400 |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-05-09 11:44:30 -0400 |
commit | 8170e8c0d12cb9414f3a3d3ca81a447b4afc5f26 (patch) | |
tree | d6353155110b49bf7953fd0d7d3f808512e8feb1 /Lib/difflib.py | |
parent | bd60e8dece89440ebdc80a19b2217d5ba2515124 (diff) | |
download | cpython-git-8170e8c0d12cb9414f3a3d3ca81a447b4afc5f26.tar.gz |
PEP 479: Change StopIteration handling inside generators.
Closes issue #22906.
Diffstat (limited to 'Lib/difflib.py')
-rw-r--r-- | Lib/difflib.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/difflib.py b/Lib/difflib.py index 96fd9ab37c..aa98436ce3 100644 --- a/Lib/difflib.py +++ b/Lib/difflib.py @@ -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: |