From c886f2a27b06bb46bed57d62083c43b9c50d9672 Mon Sep 17 00:00:00 2001 From: Anthony Baxter Date: Wed, 5 Dec 2001 04:28:59 +0000 Subject: [PATCH] backport 1.11 Catch only the relevant exceptions instead of using a bare except clause. --- Lib/anydbm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/anydbm.py b/Lib/anydbm.py index ba6fa7b54aa0..f051200548f3 100644 --- a/Lib/anydbm.py +++ b/Lib/anydbm.py @@ -45,7 +45,7 @@ only if it doesn't exist; and 'n' always creates a new database. try: class error(Exception): pass -except: +except (NameError, TypeError): error = "anydbm.error" _names = ['dbhash', 'gdbm', 'dbm', 'dumbdbm'] -- 2.47.3