summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-09-22 21:30:22 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-09-22 21:30:22 (GMT)
commit8a9c284437652826a3da83ec38c4536fa111eb40 (patch)
treecd1e3df2a8b2621c2c10b7b3f788c2c4c0ac364f /Tools
parent380bad1b4e363f3b7c23677981e19e1fa3aded1b (diff)
downloadcpython-8a9c284437652826a3da83ec38c4536fa111eb40.zip
cpython-8a9c284437652826a3da83ec38c4536fa111eb40.tar.gz
cpython-8a9c284437652826a3da83ec38c4536fa111eb40.tar.bz2
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.
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/ndiff.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Tools/scripts/ndiff.py b/Tools/scripts/ndiff.py
index a5468f6..6f0f9a9 100755
--- a/Tools/scripts/ndiff.py
+++ b/Tools/scripts/ndiff.py
@@ -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