mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix use of 'file' as a variable name.
(I've tested the fixes, but please proofread anyway.)
This commit is contained in:
parent
bf1bef820c
commit
ac6df95d07
16 changed files with 108 additions and 107 deletions
|
@ -34,15 +34,15 @@ status = 0 # Exit status, set to 1 on errors
|
|||
|
||||
# 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 @@ for file in sys.argv[1:]:
|
|||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue