Mercurial > cpython-lru_cache-weakref
diff Tools/scripts/which.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 | 86c476a425a7 |
line wrap: on
line diff
--- a/Tools/scripts/which.py Tue May 13 18:01:19 2003 +0000 +++ b/Tools/scripts/which.py Tue May 13 18:14:25 2003 +0000 @@ -25,29 +25,29 @@ for prog in sys.argv[1:]: ident = () for dir in pathlist: - file = os.path.join(dir, prog) + filename = os.path.join(dir, prog) try: - st = os.stat(file) + st = os.stat(filename) except os.error: continue if not S_ISREG(st[ST_MODE]): - msg(file + ': not a disk file') + msg(filename + ': not a disk file') else: mode = S_IMODE(st[ST_MODE]) if mode & 0111: if not ident: - print file + print filename ident = st[:3] else: if st[:3] == ident: s = 'same as: ' else: s = 'also: ' - msg(s + file) + msg(s + filename) else: - msg(file + ': not executable') + msg(filename + ': not executable') if longlist: - sts = os.system('ls ' + longlist + ' ' + file) + sts = os.system('ls ' + longlist + ' ' + filename) if sts: msg('"ls -l" exit status: ' + `sts`) if not ident: msg(prog + ': not found')
