]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Use KeyError.
authorGuido van Rossum <guido@python.org>
Thu, 26 Dec 1991 13:03:14 +0000 (13:03 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 26 Dec 1991 13:03:14 +0000 (13:03 +0000)
Lib/cmp.py
Lib/dircache.py

index 434caee06c27098f0021ec1ea8f11dced4daa0f4..32b77fac9bd49d613a6124eba64d5a8fdacb2b7a 100644 (file)
@@ -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
index 1eebbbc61d63b50d21e95135445b59ad21a433ff..9cdbc70009bb6fe4fc2e23bdb3e7746424a71e95 100644 (file)
@@ -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]