Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae39fbd commit bbeac6eCopy full SHA for bbeac6e
1 file changed
Lib/difflib.py
@@ -1448,10 +1448,7 @@ def _line_iterator():
1448
# are a concatenation of the first character of each of the 4 lines
1449
# so we can do some very readable comparisons.
1450
while len(lines) < 4:
1451
- try:
1452
- lines.append(next(diff_lines_iterator))
1453
- except StopIteration:
1454
- lines.append('X')
+ lines.append(next(diff_lines_iterator, 'X'))
1455
s = ''.join([line[0] for line in lines])
1456
if s.startswith('X'):
1457
# When no more lines, pump out any remaining blank lines so the
@@ -1514,7 +1511,7 @@ def _line_iterator():
1514
1511
num_blanks_to_yield -= 1
1515
1512
yield ('','\n'),None,True
1516
1513
1517
- raise StopIteration
+ return
1518
else:
1519
yield from_line,to_line,True
1520
0 commit comments