summaryrefslogtreecommitdiffstats
path: root/Lib/difflib.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-05-09 15:44:30 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-05-09 15:44:30 (GMT)
commit8170e8c0d12cb9414f3a3d3ca81a447b4afc5f26 (patch)
treed6353155110b49bf7953fd0d7d3f808512e8feb1 /Lib/difflib.py
parentbd60e8dece89440ebdc80a19b2217d5ba2515124 (diff)
downloadcpython-8170e8c0d12cb9414f3a3d3ca81a447b4afc5f26.zip
cpython-8170e8c0d12cb9414f3a3d3ca81a447b4afc5f26.tar.gz
cpython-8170e8c0d12cb9414f3a3d3ca81a447b4afc5f26.tar.bz2
PEP 479: Change StopIteration handling inside generators.
Closes issue #22906.
Diffstat (limited to 'Lib/difflib.py')
-rw-r--r--Lib/difflib.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/difflib.py b/Lib/difflib.py
index 96fd9ab..aa98436 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: