Mercurial > cpython-lru_cache-weakref
diff Tools/scripts/which.py @ 755:2dd5dbf28a2d legacy-trunk
change posix to os
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 30 Mar 1992 11:13:59 +0000 |
| parents | ca28a3a82bba |
| children | 28948181fb2f |
line wrap: on
line diff
--- a/Tools/scripts/which.py Mon Mar 30 11:12:23 1992 +0000 +++ b/Tools/scripts/which.py Mon Mar 30 11:13:59 1992 +0000 @@ -4,13 +4,13 @@ # On stderr, near and total misses are reported. # '-l<flags>' argument adds ls -l<flags> of each file found. -import sys, posix, string, path +import sys, os, string from stat import * def msg(str): sys.stderr.write(str + '\n') -pathlist = string.splitfields(posix.environ['PATH'], ':') +pathlist = string.splitfields(os.environ['PATH'], ':') sts = 0 longlist = '' @@ -22,10 +22,10 @@ for prog in sys.argv[1:]: ident = () for dir in pathlist: - file = path.join(dir, prog) + file = os.path.join(dir, prog) try: - st = posix.stat(file) - except posix.error: + st = os.stat(file) + except os.error: continue if not S_ISREG(st[ST_MODE]): msg(file + ': not a disk file') @@ -44,7 +44,7 @@ else: msg(file + ': not executable') if longlist: - sts = posix.system('ls ' + longlist + ' ' + file) + sts = os.system('ls ' + longlist + ' ' + file) if sts: msg('"ls -l" exit status: ' + `sts`) if not ident: msg(prog + ': not found')
