[Python-checkins] python/dist/src/Tools/scripts lfcr.py,1.3,1.4

akuchling@users.sourceforge.net akuchling@users.sourceforge.net
Tue, 13 May 2003 10:09:04 -0700


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

Modified Files:
	lfcr.py 
Log Message:
[Bug #724767] Avoid use of 'file' as a variable name


Index: lfcr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/scripts/lfcr.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** lfcr.py	14 Feb 2000 21:42:14 -0000	1.3
--- lfcr.py	13 May 2003 17:09:01 -0000	1.4
***************
*** 4,19 ****
  
  import sys, re, os
! for file in sys.argv[1:]:
!     if os.path.isdir(file):
!         print file, "Directory!"
          continue
!     data = open(file, "rb").read()
      if '\0' in data:
!         print file, "Binary!"
          continue
      newdata = re.sub("\r?\n", "\r\n", data)
      if newdata != data:
!         print file
!         f = open(file, "wb")
          f.write(newdata)
          f.close()
--- 4,19 ----
  
  import sys, re, os
! for filename in sys.argv[1:]:
!     if os.path.isdir(filename):
!         print filename, "Directory!"
          continue
!     data = open(filename, "rb").read()
      if '\0' in data:
!         print filename, "Binary!"
          continue
      newdata = re.sub("\r?\n", "\r\n", data)
      if newdata != data:
!         print filename
!         f = open(filename, "wb")
          f.write(newdata)
          f.close()