diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-04-28 18:09:37 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-04-29 20:57:15 +0200 |
| commit | 3904b74a3f2f92fefe1d39281ed683c52f2fef03 (patch) | |
| tree | 1ae8f65371ed53df205553f41c9d0f90d1e9fee9 /django/dispatch | |
| parent | eefb00f30124f775ca52258ccd8549054fe8230f (diff) | |
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).
Diffstat (limited to 'django/dispatch')
| -rw-r--r-- | django/dispatch/dispatcher.py | 2 | ||||
| -rw-r--r-- | django/dispatch/saferef.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/django/dispatch/dispatcher.py b/django/dispatch/dispatcher.py index ed9da57f27..0903c3a8a9 100644 --- a/django/dispatch/dispatcher.py +++ b/django/dispatch/dispatcher.py @@ -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)) diff --git a/django/dispatch/saferef.py b/django/dispatch/saferef.py index 1c7d16474f..364c13e43b 100644 --- a/django/dispatch/saferef.py +++ b/django/dispatch/saferef.py @@ -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 ) |
