summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2008-05-29 12:40:25 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2008-05-29 12:40:25 +0000
commitf696c175d855be16ecb6acadee75044db0677f7a (patch)
tree44ab3a985f535f4d9304c50700429a8e4a5d26ba
parent5837a45bd94ac06c7e2036b89701e579a2fe9faf (diff)
Fixed #6950 -- Modified initialization of template loaders to use a temporary variable instead of directly modifying the global loader list. Thanks, mrts.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7563 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/template/loader.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/template/loader.py b/django/template/loader.py
index 03e6f8d49d..1d7d945ef7 100644
--- a/django/template/loader.py
+++ b/django/template/loader.py
@@ -46,7 +46,7 @@ def find_template_source(name, dirs=None):
# circular import errors. See Django ticket #1292.
global template_source_loaders
if template_source_loaders is None:
- template_source_loaders = []
+ loaders = []
for path in settings.TEMPLATE_LOADERS:
i = path.rfind('.')
module, attr = path[:i], path[i+1:]
@@ -62,7 +62,8 @@ def find_template_source(name, dirs=None):
import warnings
warnings.warn("Your TEMPLATE_LOADERS setting includes %r, but your Python installation doesn't support that type of template loading. Consider removing that line from TEMPLATE_LOADERS." % path)
else:
- template_source_loaders.append(func)
+ loaders.append(func)
+ template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)