diff options
author | Fred Drake <fdrake@acm.org> | 2001-05-11 18:27:00 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-05-11 18:27:00 (GMT) |
commit | c79f3d0d42b29723290f8741bb8a296ef1c61712 (patch) | |
tree | 74d63e94a2830d5b7dedbb0d3096255272b7b656 /Lib | |
parent | ba7e2c8a27c8d059520548a474d31d8770c81fcd (diff) | |
download | cpython-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.py | 2 |
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'] |