Skip to content

Commit 7b58a2c

Browse files
author
Ryan P Kilby
committed
Fix bare except statements
1 parent eb61eb2 commit 7b58a2c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

rest_framework/schemas/inspectors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def get_path_fields(self, path, method):
260260
# Attempt to infer a field description if possible.
261261
try:
262262
model_field = model._meta.get_field(variable)
263-
except:
263+
except Exception:
264264
model_field = None
265265

266266
if model_field is not None and model_field.verbose_name:

rest_framework/utils/encoders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def default(self, obj):
6161
elif hasattr(obj, '__getitem__'):
6262
try:
6363
return dict(obj)
64-
except:
64+
except Exception:
6565
pass
6666
elif hasattr(obj, '__iter__'):
6767
return tuple(item for item in obj)

0 commit comments

Comments
 (0)