diff options
author | Fred Drake <fdrake@acm.org> | 2001-05-11 18:27:00 +0000 |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-05-11 18:27:00 +0000 |
commit | 374a29a1bbdd3ccbd124c69c280a73072372d14f (patch) | |
tree | 0fac6821e65b75db9dde0b0497a3e0559e2d6a81 /Lib/anydbm.py | |
parent | c388337c3dc78d3b81a0f55567fd54465ce418bd (diff) | |
download | cpython-374a29a1bbdd3ccbd124c69c280a73072372d14f.tar.gz |
Catch only the relevant exceptions instead of using a bare except clause.
Diffstat (limited to 'Lib/anydbm.py')
-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 ba6fa7b54a..f051200548 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'] |