diff options
author | Guido van Rossum <guido@python.org> | 1991-12-26 13:03:14 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1991-12-26 13:03:14 (GMT) |
commit | 4dedbf7197e679b432fd3f06d8e36a223ae78f00 (patch) | |
tree | d18cac8c4186f1f3d4279011a42c22471fa51434 /Lib | |
parent | 5c5e829a5d23f2cbffd188ebc3688147bc38b2e3 (diff) | |
download | cpython-4dedbf7197e679b432fd3f06d8e36a223ae78f00.zip cpython-4dedbf7197e679b432fd3f06d8e36a223ae78f00.tar.gz cpython-4dedbf7197e679b432fd3f06d8e36a223ae78f00.tar.bz2 |
Use KeyError.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/cmp.py | 2 | ||||
-rw-r--r-- | Lib/dircache.py | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -34,7 +34,7 @@ def cmp(f1, f2): # Compare two files, use the cache if possible. # cached signatures match return outcome # stale cached signature(s) - except RuntimeError: + except KeyError: # cache miss pass # really compare diff --git a/Lib/dircache.py b/Lib/dircache.py index 1eebbbc..9cdbc70 100644 --- a/Lib/dircache.py +++ b/Lib/dircache.py @@ -13,7 +13,7 @@ def listdir(path): # List directory contents, using cache try: cached_mtime, list = cache[path] del cache[path] - except RuntimeError: + except KeyError: cached_mtime, list = -1, [] try: mtime = posix.stat(path)[8] |