mirror of
https://github.com/django/django.git
synced 2025-11-03 05:13:23 +00:00
Fixed #18013 -- Use the new 'as' syntax for exceptions.
Thanks Clueless for the initial patch. Note that unittest has been purposely left out (external package only used by Python 2.6).
This commit is contained in:
parent
eefb00f301
commit
3904b74a3f
107 changed files with 306 additions and 354 deletions
|
|
@ -118,13 +118,13 @@ class BaseMiddlewareExceptionTest(TestCase):
|
|||
def assert_exceptions_handled(self, url, errors, extra_error=None):
|
||||
try:
|
||||
response = self.client.get(url)
|
||||
except TestException, e:
|
||||
except TestException:
|
||||
# Test client intentionally re-raises any exceptions being raised
|
||||
# during request handling. Hence actual testing that exception was
|
||||
# properly handled is done by relying on got_request_exception
|
||||
# signal being sent.
|
||||
pass
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
if type(extra_error) != type(e):
|
||||
self.fail("Unexpected exception: %s" % e)
|
||||
self.assertEqual(len(self.exceptions), len(errors))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue