mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Make difflib.ndiff() and difflib.Differ.compare() generators. This
restores the 2.1 ability of Tools/scripts/ndiff.py to start producing output before the entire comparison is complete.
This commit is contained in:
parent
380bad1b4e
commit
8a9c284437
4 changed files with 84 additions and 70 deletions
|
@ -73,9 +73,8 @@ def fcompare(f1name, f2name):
|
|||
|
||||
a = f1.readlines(); f1.close()
|
||||
b = f2.readlines(); f2.close()
|
||||
|
||||
diff = difflib.ndiff(a, b)
|
||||
sys.stdout.writelines(diff)
|
||||
for line in difflib.ndiff(a, b):
|
||||
print line,
|
||||
|
||||
return 1
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue