posix -> os

This commit is contained in:
Guido van Rossum 1992-03-31 19:04:48 +00:00
parent 3bc034bb79
commit 25d7cafd8a
10 changed files with 35 additions and 35 deletions

View file

@ -3,11 +3,11 @@
# Maintain a cache of file stats.
# There are functions to reset the cache or to selectively remove items.
import posix
import os
from stat import *
# The cache.
# Keys are pathnames, values are `posix.stat' outcomes.
# Keys are pathnames, values are `os.stat' outcomes.
#
cache = {}
@ -17,7 +17,7 @@ cache = {}
def stat(path):
if cache.has_key(path):
return cache[path]
cache[path] = ret = posix.stat(path)
cache[path] = ret = os.stat(path)
return ret
@ -81,6 +81,6 @@ def forget_except_prefix(prefix):
def isdir(path):
try:
st = stat(path)
except posix.error:
except os.error:
return 0
return S_ISDIR(st[ST_MODE])