diff options
| author | Aymeric Augustin | 2013-10-16 22:43:10 +0200 | 
|---|---|---|
| committer | Aymeric Augustin | 2013-10-17 18:24:57 +0200 | 
| commit | a5d97931033a142a65d6ccdd06b5d345f535513d (patch) | |
| tree | 16ae04a2d7a82ee4737dbddfe9c9b5549434398c | |
| parent | eacf116d61f0e3f47a7c581275a18b3aec8548b1 (diff) | |
| download | django-debug-toolbar-a5d97931033a142a65d6ccdd06b5d345f535513d.tar.bz2 | |
Modernize exception catching syntax.
| -rw-r--r-- | debug_toolbar/__init__.py | 2 | ||||
| -rw-r--r-- | debug_toolbar/toolbar/loader.py | 2 | ||||
| -rw-r--r-- | debug_toolbar/utils/tracking/__init__.py | 2 | 
3 files changed, 3 insertions, 3 deletions
| diff --git a/debug_toolbar/__init__.py b/debug_toolbar/__init__.py index 48da4a6..feb6925 100644 --- a/debug_toolbar/__init__.py +++ b/debug_toolbar/__init__.py @@ -3,5 +3,5 @@ __all__ = ('VERSION',)  try:      VERSION = __import__('pkg_resources') \          .get_distribution('django-debug-toolbar').version -except Exception, e: +except Exception as e:      VERSION = 'unknown' diff --git a/debug_toolbar/toolbar/loader.py b/debug_toolbar/toolbar/loader.py index c9d2213..f26d814 100644 --- a/debug_toolbar/toolbar/loader.py +++ b/debug_toolbar/toolbar/loader.py @@ -90,7 +90,7 @@ def load_panel_classes():          panel_module, panel_classname = panel_path[:dot], panel_path[dot + 1:]          try:              mod = import_module(panel_module) -        except ImportError, e: +        except ImportError as e:              raise ImproperlyConfigured(                  'Error importing debug panel %s: "%s"' %                  (panel_module, e)) diff --git a/debug_toolbar/utils/tracking/__init__.py b/debug_toolbar/utils/tracking/__init__.py index 766c248..9a59273 100644 --- a/debug_toolbar/utils/tracking/__init__.py +++ b/debug_toolbar/utils/tracking/__init__.py @@ -37,7 +37,7 @@ def fire_hook(hook, sender, **kwargs):      try:          for callback in callbacks[hook].get(id(sender), []):              callback(sender=sender, **kwargs) -    except Exception, e: +    except Exception as e:          # Log the exception, dont mess w/ the underlying function          logging.exception(e) | 
