From c485e236bd7e5ea40c64b2fe54d85dbb15b2fd39 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Wed, 18 Mar 2009 16:55:59 +0000 Subject: 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 --- django/template/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'django/template/__init__.py') diff --git a/django/template/__init__.py b/django/template/__init__.py index bdc4b890d1..d008b7f874 100644 --- a/django/template/__init__.py +++ b/django/template/__init__.py @@ -52,6 +52,7 @@ import re from inspect import getargspec from django.conf import settings from django.template.context import Context, RequestContext, ContextPopException +from django.utils.importlib import import_module from django.utils.itercompat import is_iterable from django.utils.functional import curry, Promise from django.utils.text import smart_split @@ -935,7 +936,7 @@ def get_library(module_name): lib = libraries.get(module_name, None) if not lib: try: - mod = __import__(module_name, {}, {}, ['']) + mod = import_module(module_name) except ImportError, e: raise InvalidTemplateLibrary("Could not load template library from %s, %s" % (module_name, e)) try: -- cgit v1.3