diff Tools/scripts/byteyears.py @ 29107:93c92f20b6bf legacy-trunk

Fix use of 'file' as a variable name. (I've tested the fixes, but please proofread anyway.)
author Andrew M. Kuchling <amk@amk.ca>
date Tue, 13 May 2003 18:14:25 +0000
parents 8a7a2f1f88f0
children 71a294bd7950
line wrap: on
line diff
--- a/Tools/scripts/byteyears.py	Tue May 13 18:01:19 2003 +0000
+++ b/Tools/scripts/byteyears.py	Tue May 13 18:14:25 2003 +0000
@@ -34,15 +34,15 @@
 
 # Compute max file name length
 maxlen = 1
-for file in sys.argv[1:]:
-    if len(file) > maxlen: maxlen = len(file)
+for filename in sys.argv[1:]:
+    maxlen = max(maxlen, len(filename))
 
 # Process each argument in turn
-for file in sys.argv[1:]:
+for filename in sys.argv[1:]:
     try:
-        st = statfunc(file)
+        st = statfunc(filename)
     except os.error, msg:
-        sys.stderr.write('can\'t stat ' + `file` + ': ' + `msg` + '\n')
+        sys.stderr.write('can\'t stat ' + `filename` + ': ' + `msg` + '\n')
         status = 1
         st = ()
     if st:
@@ -50,7 +50,7 @@
         size = st[ST_SIZE]
         age = now - anytime
         byteyears = float(size) * float(age) / secs_per_year
-        print file.ljust(maxlen),
+        print filename.ljust(maxlen),
         print repr(int(byteyears)).rjust(8)
 
 sys.exit(status)