summaryrefslogtreecommitdiff
path: root/django/template/context.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/template/context.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/template/context.py')
-rw-r--r--django/template/context.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/template/context.py b/django/template/context.py
index 8f16a95021..1f136595e1 100644
--- a/django/template/context.py
+++ b/django/template/context.py
@@ -1,5 +1,6 @@
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
+from django.utils.importlib import import_module
_standard_context_processors = None
@@ -62,7 +63,7 @@ class Context(object):
def update(self, other_dict):
"Like dict.update(). Pushes an entire dictionary's keys and values onto the context."
- if not hasattr(other_dict, '__getitem__'):
+ if not hasattr(other_dict, '__getitem__'):
raise TypeError('other_dict must be a mapping (dictionary-like) object.')
self.dicts = [other_dict] + self.dicts
return other_dict
@@ -77,7 +78,7 @@ def get_standard_processors():
i = path.rfind('.')
module, attr = path[:i], path[i+1:]
try:
- mod = __import__(module, {}, {}, [attr])
+ mod = import_module(module)
except ImportError, e:
raise ImproperlyConfigured('Error importing request processor module %s: "%s"' % (module, e))
try: