From bd7977eed79bd8fc4d9e73b6d848b0f0cd5a72ec Mon Sep 17 00:00:00 2001 From: Marc Tamlyn Date: Wed, 6 Feb 2013 13:05:17 +0000 Subject: Purge naked excepts. Most of these had obvious exceptions which would be thrown. Some I'm not sure about but they should at least catch only Exception so as not to ignore SystemExit and other inappropriate Error classes. --- rest_framework/tests/urlpatterns.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rest_framework/tests') diff --git a/rest_framework/tests/urlpatterns.py b/rest_framework/tests/urlpatterns.py index 41245ad1..82cd6cdb 100644 --- a/rest_framework/tests/urlpatterns.py +++ b/rest_framework/tests/urlpatterns.py @@ -23,14 +23,14 @@ class FormatSuffixTests(TestCase): factory = RequestFactory() try: urlpatterns = format_suffix_patterns(urlpatterns) - except: + except Exception: self.fail("Failed to apply `format_suffix_patterns` on the supplied urlpatterns") resolver = urlresolvers.RegexURLResolver(r'^/', urlpatterns) for test_path in test_paths: request = factory.get(test_path.path) try: callback, callback_args, callback_kwargs = resolver.resolve(request.path_info) - except: + except Exception: self.fail("Failed to resolve URL: %s" % request.path_info) self.assertEquals(callback_args, test_path.args) self.assertEquals(callback_kwargs, test_path.kwargs) -- cgit v1.2.3