Merge pull request #109 from jakul/bare_except_stmts

Change 'except' for 'except Exception' (Fixes issue #75)
This commit is contained in:
Marko Tibold 2012-01-04 10:19:40 -08:00
commit b745d0c2f4
5 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -43,7 +43,7 @@ def url_resolves(url):
"""
try:
resolve(url)
except:
except Exception:
return False
return True

View File

@ -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

View File

@ -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):

View File

@ -18,7 +18,7 @@ class TestPygmentsExample(TestCase):
def tearDown(self):
try:
shutil.rmtree(self.temp_dir)
except:
except Exception:
pass
def test_get_to_root(self):