Kaydet (Commit) c79f3d0d authored tarafından Fred Drake's avatar Fred Drake

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

üst ba7e2c8a
......@@ -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']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment