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:
Tim Peters 2001-09-22 21:30:22 +00:00
parent 380bad1b4e
commit 8a9c284437
4 changed files with 84 additions and 70 deletions

View file

@ -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