aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-09-22 21:30:22 +0000
committerTim Peters <tim.peters@gmail.com>2001-09-22 21:30:22 +0000
commit8a9c284437652826a3da83ec38c4536fa111eb40 (patch)
treecd1e3df2a8b2621c2c10b7b3f788c2c4c0ac364f /Tools
parentAdd note about __getattribute__. (diff)
downloadcpython-8a9c284437652826a3da83ec38c4536fa111eb40.tar.gz
cpython-8a9c284437652826a3da83ec38c4536fa111eb40.tar.bz2
cpython-8a9c284437652826a3da83ec38c4536fa111eb40.zip
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 a5468f6732e..6f0f9a9cf34 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