Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
50399ae5
Commit
50399ae5
authored
Mar 31, 1992
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mac -> os (can't this go now dircache is universal?)
parent
d9596e3a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Mac/Lib/maccache.py
Mac/Lib/maccache.py
+6
-6
No files found.
Mac/Lib/maccache.py
View file @
50399ae5
# 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
=
mac
path
.
join
(
cwd
,
name
)
name
=
os
.
path
.
join
(
cwd
,
name
)
if
cache
.
has_key
(
name
):
return
cache
[
name
]
if
mac
path
.
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment