Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c79f3d0

Browse files
committed
Catch only the relevant exceptions instead of using a bare except clause.
1 parent ba7e2c8 commit c79f3d0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/anydbm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
try:
4646
class error(Exception):
4747
pass
48-
except:
48+
except (NameError, TypeError):
4949
error = "anydbm.error"
5050

5151
_names = ['dbhash', 'gdbm', 'dbm', 'dumbdbm']

0 commit comments

Comments
 (0)