Commit 46e4ba25 by Craig Blaszczyk

#75 remove except statements which are overly broad in the exception they catch

parent be11336d
...@@ -246,14 +246,14 @@ class DocumentingTemplateRenderer(BaseRenderer): ...@@ -246,14 +246,14 @@ class DocumentingTemplateRenderer(BaseRenderer):
form_instance = view.get_bound_form(view.response.cleaned_content, method=method) form_instance = view.get_bound_form(view.response.cleaned_content, method=method)
if form_instance and not form_instance.is_valid(): if form_instance and not form_instance.is_valid():
form_instance = None form_instance = None
except: except Exception:
form_instance = None form_instance = None
# If we still don't have a form instance then try to get an unbound form # If we still don't have a form instance then try to get an unbound form
if not form_instance: if not form_instance:
try: try:
form_instance = view.get_bound_form(method=method) form_instance = view.get_bound_form(method=method)
except: except Exception:
pass pass
# If we still don't have a form instance then try to get an unbound form which can tunnel arbitrary content types # If we still don't have a form instance then try to get an unbound form which can tunnel arbitrary content types
......
...@@ -43,7 +43,7 @@ def url_resolves(url): ...@@ -43,7 +43,7 @@ def url_resolves(url):
""" """
try: try:
resolve(url) resolve(url)
except: except Exception:
return False return False
return True return True
......
...@@ -11,7 +11,7 @@ def get_breadcrumbs(url): ...@@ -11,7 +11,7 @@ def get_breadcrumbs(url):
try: try:
(view, unused_args, unused_kwargs) = resolve(url) (view, unused_args, unused_kwargs) = resolve(url)
except: except Exception:
pass pass
else: else:
# Check if this is a REST framework view, and if so add it to the breadcrumbs # Check if this is a REST framework view, and if so add it to the breadcrumbs
......
...@@ -109,7 +109,7 @@ class _MediaType(object): ...@@ -109,7 +109,7 @@ class _MediaType(object):
# """ # """
# try: # try:
# return Decimal(self.params.get('q', '1.0')) # return Decimal(self.params.get('q', '1.0'))
# except: # except Exception:
# return Decimal(0) # return Decimal(0)
#def score(self): #def score(self):
......
...@@ -18,7 +18,7 @@ class TestPygmentsExample(TestCase): ...@@ -18,7 +18,7 @@ class TestPygmentsExample(TestCase):
def tearDown(self): def tearDown(self):
try: try:
shutil.rmtree(self.temp_dir) shutil.rmtree(self.temp_dir)
except: except Exception:
pass pass
def test_get_to_root(self): def test_get_to_root(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment