mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +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:
@@ -205,7 +205,7 @@ class Signal(object):
|
||||
for receiver in self._live_receivers(_make_id(sender)):
|
||||
try:
|
||||
response = receiver(signal=self, sender=sender, **named)
|
||||
except Exception, err:
|
||||
except Exception as err:
|
||||
responses.append((receiver, err))
|
||||
else:
|
||||
responses.append((receiver, response))
|
||||
|
||||
@@ -119,10 +119,10 @@ class BoundMethodWeakref(object):
|
||||
try:
|
||||
if callable( function ):
|
||||
function( self )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
try:
|
||||
traceback.print_exc()
|
||||
except AttributeError, err:
|
||||
except AttributeError as err:
|
||||
print '''Exception during saferef %s cleanup function %s: %s'''%(
|
||||
self, function, e
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user