diff options
author | Raymond Hettinger <python@rcn.com> | 2002-06-01 19:51:15 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2002-06-01 19:51:15 (GMT) |
commit | 32200aeac697fcb3f2b4528127a2fbf0a22a8f17 (patch) | |
tree | b99f2c04d576a3699ab9a2b6dfc1fc0e31e3c734 /Lib/pydoc.py | |
parent | 16e3c427f35589ac3b83e8c13a8ec6495ec6cfa1 (diff) | |
download | cpython-32200aeac697fcb3f2b4528127a2fbf0a22a8f17.zip cpython-32200aeac697fcb3f2b4528127a2fbf0a22a8f17.tar.gz cpython-32200aeac697fcb3f2b4528127a2fbf0a22a8f17.tar.bz2 |
Replaced obsolete stat module constants with equivalent attributes
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-x | Lib/pydoc.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 8bb4c7b..962e32e 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -43,7 +43,7 @@ Mynd you, møøse bites Kan be pretty nasti...""" # the current directory is changed with os.chdir(), an incorrect # path will be displayed. -import sys, imp, os, stat, re, types, inspect +import sys, imp, os, re, types, inspect from repr import Repr from string import expandtabs, find, join, lower, split, strip, rfind, rstrip @@ -153,7 +153,7 @@ def ispackage(path): def synopsis(filename, cache={}): """Get the one-line summary out of a module file.""" - mtime = os.stat(filename)[stat.ST_MTIME] + mtime = os.stat(filename).st_mtime lastupdate, result = cache.get(filename, (0, None)) if lastupdate < mtime: info = inspect.getmoduleinfo(filename) @@ -1698,7 +1698,7 @@ class ModuleScanner(Scanner): def __init__(self): roots = map(lambda dir: (dir, ''), pathdirs()) Scanner.__init__(self, roots, self.submodules, self.isnewpackage) - self.inodes = map(lambda (dir, pkg): os.stat(dir)[1], roots) + self.inodes = map(lambda (dir, pkg): os.stat(dir).st_ino, roots) def submodules(self, (dir, package)): children = [] @@ -1712,7 +1712,7 @@ class ModuleScanner(Scanner): return children def isnewpackage(self, (dir, package)): - inode = os.path.exists(dir) and os.stat(dir)[1] + inode = os.path.exists(dir) and os.stat(dir).st_ino if not (os.path.islink(dir) and inode in self.inodes): self.inodes.append(inode) # detect circular symbolic links return ispackage(dir) |