Catch only the relevant exceptions instead of using a bare except clause.

This commit is contained in:
Fred Drake 2001-05-11 18:27:00 +00:00
parent ba7e2c8a27
commit c79f3d0d42

View file

@ -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']