summaryrefslogtreecommitdiff
path: root/django/core/handlers/base.py
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2009-03-18 16:55:59 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2009-03-18 16:55:59 +0000
commitc485e236bd7e5ea40c64b2fe54d85dbb15b2fd39 (patch)
treefc5e86abf39b69181b2084f5c39038f1811b6b44 /django/core/handlers/base.py
parentee2f04d79e5bca55637b9bb3301618738a4e342a (diff)
Fixed #8193: all dynamic imports in Django are now done correctly. I know this because Brett Cannon borrowed the time machine and brought Python 2.7's '`importlib` back for inclusion in Django. Thanks for the patch-from-the-future, Brett!
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10088 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/handlers/base.py')
-rw-r--r--django/core/handlers/base.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/core/handlers/base.py b/django/core/handlers/base.py
index f1b69c59c2..e6ef6e2f9e 100644
--- a/django/core/handlers/base.py
+++ b/django/core/handlers/base.py
@@ -3,6 +3,7 @@ import sys
from django import http
from django.core import signals
from django.utils.encoding import force_unicode
+from django.utils.importlib import import_module
class BaseHandler(object):
# Changes that are always applied to a response (in this order).
@@ -36,7 +37,7 @@ class BaseHandler(object):
raise exceptions.ImproperlyConfigured, '%s isn\'t a middleware module' % middleware_path
mw_module, mw_classname = middleware_path[:dot], middleware_path[dot+1:]
try:
- mod = __import__(mw_module, {}, {}, [''])
+ mod = import_module(mw_module)
except ImportError, e:
raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e)
try: