From 4dedbf7197e679b432fd3f06d8e36a223ae78f00 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 26 Dec 1991 13:03:14 +0000 Subject: Use KeyError. --- Lib/cmp.py | 2 +- Lib/dircache.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/cmp.py b/Lib/cmp.py index 434caee06c..32b77fac9b 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 1eebbbc61d..9cdbc70009 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] -- cgit v1.2.1