diff options
| author | Jannis Leidel | 2012-05-13 12:12:56 +0200 |
|---|---|---|
| committer | Jannis Leidel | 2012-05-13 12:12:56 +0200 |
| commit | 7fa83ed02ee038802d41f955966c892148385bae (patch) | |
| tree | 711baff3e8057d4bc88c0f9c9b84f15f810d07da /debug_toolbar/toolbar/loader.py | |
| parent | c590c7e1f825e2610f25e5512794aeb24fdf0cd5 (diff) | |
| download | django-debug-toolbar-7fa83ed02ee038802d41f955966c892148385bae.tar.bz2 | |
Minor cosmetic cleanup, switching out __import__ calls with the proper use of Django's import_module.
Diffstat (limited to 'debug_toolbar/toolbar/loader.py')
| -rw-r--r-- | debug_toolbar/toolbar/loader.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/debug_toolbar/toolbar/loader.py b/debug_toolbar/toolbar/loader.py index 4d09a27..02a558d 100644 --- a/debug_toolbar/toolbar/loader.py +++ b/debug_toolbar/toolbar/loader.py @@ -7,6 +7,7 @@ import os.path from django.conf import settings from django.template.loader import render_to_string from django.utils.datastructures import SortedDict +from django.utils.importlib import import_module from django.utils.safestring import mark_safe @@ -91,10 +92,10 @@ def load_panel_classes(): dot = panel_path.rindex('.') except ValueError: raise ImproperlyConfigured( - '%s isn\'t a debug panel module' % panel_path) + "%s isn't a debug panel module" % panel_path) panel_module, panel_classname = panel_path[:dot], panel_path[dot + 1:] try: - mod = __import__(panel_module, {}, {}, ['']) + mod = import_module(panel_module) except ImportError, e: raise ImproperlyConfigured( 'Error importing debug panel %s: "%s"' % |
