mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +03:00
Fix bare except statements
This commit is contained in:
parent
eb61eb2b86
commit
7b58a2c124
|
@ -260,7 +260,7 @@ class AutoSchema(ViewInspector):
|
|||
# Attempt to infer a field description if possible.
|
||||
try:
|
||||
model_field = model._meta.get_field(variable)
|
||||
except:
|
||||
except Exception:
|
||||
model_field = None
|
||||
|
||||
if model_field is not None and model_field.verbose_name:
|
||||
|
|
|
@ -61,7 +61,7 @@ class JSONEncoder(json.JSONEncoder):
|
|||
elif hasattr(obj, '__getitem__'):
|
||||
try:
|
||||
return dict(obj)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
elif hasattr(obj, '__iter__'):
|
||||
return tuple(item for item in obj)
|
||||
|
|
Loading…
Reference in New Issue
Block a user