From 8170e8c0d12cb9414f3a3d3ca81a447b4afc5f26 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Sat, 9 May 2015 11:44:30 -0400 Subject: PEP 479: Change StopIteration handling inside generators. Closes issue #22906. --- Lib/difflib.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Lib/difflib.py') 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: -- cgit v1.2.1