[Python-checkins] CVS: python/dist/src/Tools/scripts ndiff.py,1.9,1.10

Tim Peters tim_one@users.sourceforge.net
Sat, 22 Sep 2001 14:30:24 -0700


Update of /cvsroot/python/python/dist/src/Tools/scripts
In directory usw-pr-cvs1:/tmp/cvs-serv24440/python/Tools/scripts

Modified Files:
	ndiff.py 
Log Message:
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.


Index: ndiff.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/scripts/ndiff.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** ndiff.py	2001/08/12 22:25:01	1.9
--- ndiff.py	2001/09/22 21:30:22	1.10
***************
*** 74,80 ****
      a = f1.readlines(); f1.close()
      b = f2.readlines(); f2.close()
! 
!     diff = difflib.ndiff(a, b)
!     sys.stdout.writelines(diff)
  
      return 1
--- 74,79 ----
      a = f1.readlines(); f1.close()
      b = f2.readlines(); f2.close()
!     for line in difflib.ndiff(a, b):
!         print line,
  
      return 1