Kaydet (Commit) 4dedbf71 authored tarafından Guido van Rossum's avatar Guido van Rossum

Use KeyError.

üst 5c5e829a
...@@ -34,7 +34,7 @@ def cmp(f1, f2): # Compare two files, use the cache if possible. ...@@ -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 ...@@ -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]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment