mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
mac -> os (can't this go now dircache is universal?)
This commit is contained in:
parent
d9596e3a79
commit
50399ae583
1 changed files with 6 additions and 6 deletions
|
@ -1,9 +1,9 @@
|
|||
# Module 'maccache'
|
||||
#
|
||||
# Maintain a cache of listdir(), isdir(), isfile() or exists() outcomes.
|
||||
# XXX Should merge with module statcache
|
||||
|
||||
import mac
|
||||
import macpath
|
||||
import os
|
||||
|
||||
|
||||
# The cache.
|
||||
|
@ -15,7 +15,7 @@ cache = {}
|
|||
|
||||
# Current working directory.
|
||||
#
|
||||
cwd = mac.getcwd()
|
||||
cwd = os.getcwd()
|
||||
|
||||
|
||||
# Constants.
|
||||
|
@ -25,14 +25,14 @@ FILE = 1
|
|||
LISTTYPE = type([])
|
||||
|
||||
def _stat(name):
|
||||
name = macpath.join(cwd, name)
|
||||
name = os.path.join(cwd, name)
|
||||
if cache.has_key(name):
|
||||
return cache[name]
|
||||
if macpath.isfile(name):
|
||||
if os.path.isfile(name):
|
||||
cache[name] = FILE
|
||||
return FILE
|
||||
try:
|
||||
list = mac.listdir(name)
|
||||
list = os.listdir(name)
|
||||
except:
|
||||
cache[name] = NONE
|
||||
return NONE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue