mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Catch only the relevant exceptions instead of using a bare except clause.
This commit is contained in:
parent
ba7e2c8a27
commit
c79f3d0d42
1 changed files with 1 additions and 1 deletions
|
|
@ -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']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue