aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework
diff options
context:
space:
mode:
authorCraig Blaszczyk2012-01-04 18:05:12 +0000
committerCraig Blaszczyk2012-01-04 18:05:12 +0000
commit46e4ba258fd2e74384a6a43b9edbe55754518bc2 (patch)
tree2f392c4543919635e6a17541dc1d98e9d560aaf8 /djangorestframework
parentbe11336dd91f26475a46f41e94c6c0fef25f53f3 (diff)
downloaddjango-rest-framework-46e4ba258fd2e74384a6a43b9edbe55754518bc2.tar.bz2
#75 remove except statements which are overly broad in the exception they catch
Diffstat (limited to 'djangorestframework')
-rw-r--r--djangorestframework/renderers.py4
-rw-r--r--djangorestframework/utils/__init__.py2
-rw-r--r--djangorestframework/utils/breadcrumbs.py2
-rw-r--r--djangorestframework/utils/mediatypes.py2
4 files changed, 5 insertions, 5 deletions
diff --git a/djangorestframework/renderers.py b/djangorestframework/renderers.py
index 0c80f07e..240de69e 100644
--- a/djangorestframework/renderers.py
+++ b/djangorestframework/renderers.py
@@ -246,14 +246,14 @@ class DocumentingTemplateRenderer(BaseRenderer):
form_instance = view.get_bound_form(view.response.cleaned_content, method=method)
if form_instance and not form_instance.is_valid():
form_instance = None
- except:
+ except Exception:
form_instance = None
# If we still don't have a form instance then try to get an unbound form
if not form_instance:
try:
form_instance = view.get_bound_form(method=method)
- except:
+ except Exception:
pass
# If we still don't have a form instance then try to get an unbound form which can tunnel arbitrary content types
diff --git a/djangorestframework/utils/__init__.py b/djangorestframework/utils/__init__.py
index 305311f4..2b4fd10e 100644
--- a/djangorestframework/utils/__init__.py
+++ b/djangorestframework/utils/__init__.py
@@ -43,7 +43,7 @@ def url_resolves(url):
"""
try:
resolve(url)
- except:
+ except Exception:
return False
return True
diff --git a/djangorestframework/utils/breadcrumbs.py b/djangorestframework/utils/breadcrumbs.py
index 6cf978ed..fd966282 100644
--- a/djangorestframework/utils/breadcrumbs.py
+++ b/djangorestframework/utils/breadcrumbs.py
@@ -11,7 +11,7 @@ def get_breadcrumbs(url):
try:
(view, unused_args, unused_kwargs) = resolve(url)
- except:
+ except Exception:
pass
else:
# Check if this is a REST framework view, and if so add it to the breadcrumbs
diff --git a/djangorestframework/utils/mediatypes.py b/djangorestframework/utils/mediatypes.py
index 3c0eefc4..c0071f01 100644
--- a/djangorestframework/utils/mediatypes.py
+++ b/djangorestframework/utils/mediatypes.py
@@ -109,7 +109,7 @@ class _MediaType(object):
# """
# try:
# return Decimal(self.params.get('q', '1.0'))
- # except:
+ # except Exception:
# return Decimal(0)
#def score(self):