From: Guido van Rossum Date: Thu, 26 Dec 1991 13:03:14 +0000 (+0000) Subject: Use KeyError. X-Git-Tag: v0.9.8~662 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4dedbf7197e679b432fd3f06d8e36a223ae78f00;p=thirdparty%2FPython%2Fcpython.git Use KeyError. --- diff --git a/Lib/cmp.py b/Lib/cmp.py index 434caee06c27..32b77fac9bd4 100644 --- a/Lib/cmp.py +++ b/Lib/cmp.py @@ -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 1eebbbc61d63..9cdbc70009bb 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]