summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-05-11 18:27:00 (GMT)
committerFred Drake <fdrake@acm.org>2001-05-11 18:27:00 (GMT)
commitc79f3d0d42b29723290f8741bb8a296ef1c61712 (patch)
tree74d63e94a2830d5b7dedbb0d3096255272b7b656 /Lib
parentba7e2c8a27c8d059520548a474d31d8770c81fcd (diff)
downloadcpython-c79f3d0d42b29723290f8741bb8a296ef1c61712.zip
cpython-c79f3d0d42b29723290f8741bb8a296ef1c61712.tar.gz
cpython-c79f3d0d42b29723290f8741bb8a296ef1c61712.tar.bz2
Catch only the relevant exceptions instead of using a bare except clause.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/anydbm.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/anydbm.py b/Lib/anydbm.py
index ba6fa7b..f051200 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']