From 7fa83ed02ee038802d41f955966c892148385bae Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Sun, 13 May 2012 12:12:56 +0200 Subject: Minor cosmetic cleanup, switching out __import__ calls with the proper use of Django's import_module. --- debug_toolbar/toolbar/loader.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'debug_toolbar/toolbar/loader.py') 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"' % -- cgit v1.2.3