mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Use KeyError.
This commit is contained in:
parent
5c5e829a5d
commit
4dedbf7197
2 changed files with 2 additions and 2 deletions
|
@ -34,7 +34,7 @@ def cmp(f1, f2): # Compare two files, use the cache if possible.
|
||||||
# cached signatures match
|
# cached signatures match
|
||||||
return outcome
|
return outcome
|
||||||
# stale cached signature(s)
|
# stale cached signature(s)
|
||||||
except RuntimeError:
|
except KeyError:
|
||||||
# cache miss
|
# cache miss
|
||||||
pass
|
pass
|
||||||
# really compare
|
# really compare
|
||||||
|
|
|
@ -13,7 +13,7 @@ def listdir(path): # List directory contents, using cache
|
||||||
try:
|
try:
|
||||||
cached_mtime, list = cache[path]
|
cached_mtime, list = cache[path]
|
||||||
del cache[path]
|
del cache[path]
|
||||||
except RuntimeError:
|
except KeyError:
|
||||||
cached_mtime, list = -1, []
|
cached_mtime, list = -1, []
|
||||||
try:
|
try:
|
||||||
mtime = posix.stat(path)[8]
|
mtime = posix.stat(path)[8]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue