diff options
author | Guido van Rossum <guido@python.org> | 1992-03-30 11:14:36 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-03-30 11:14:36 (GMT) |
commit | 391b8b7deed0d2f555ebc61e969b8798e9379081 (patch) | |
tree | 0444edc919aefa665b93a6255e7c8359d6374166 /Tools/scripts | |
parent | 01ae0a68ca09d9c769b36c4360627e76ee331ec8 (diff) | |
download | cpython-391b8b7deed0d2f555ebc61e969b8798e9379081.zip cpython-391b8b7deed0d2f555ebc61e969b8798e9379081.tar.gz cpython-391b8b7deed0d2f555ebc61e969b8798e9379081.tar.bz2 |
change posix/path to os
Diffstat (limited to 'Tools/scripts')
-rwxr-xr-x | Tools/scripts/findlinksto.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Tools/scripts/findlinksto.py b/Tools/scripts/findlinksto.py index a8051c1..709e4dc 100755 --- a/Tools/scripts/findlinksto.py +++ b/Tools/scripts/findlinksto.py @@ -4,26 +4,26 @@ # # find symbolic links to a given path -import posix, path, sys +import os, sys def visit(pattern, dirname, names): - if path.islink(dirname): + if os.path.islink(dirname): names[:] = [] return - if path.ismount(dirname): + if os.path.ismount(dirname): print 'descend into', dirname n = len(pattern) for name in names: - name = path.join(dirname, name) + name = os.path.join(dirname, name) try: - linkto = posix.readlink(name) + linkto = os.readlink(name) if linkto[:n] == pattern: print name, '->', linkto - except posix.error: + except os.error: pass def main(pattern, args): for dirname in args: - path.walk(dirname, visit, pattern) + os.path.walk(dirname, visit, pattern) main(sys.argv[1], sys.argv[2:]) |