Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #13123 -- Cleaned up template loader for PyPy compatibility. Th…

…anks to avostryakov for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12805 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 003fe522254e5ca8659e6bd57a870a29f5c4e0f7 1 parent 10de2a8
Russell Keith-Magee authored March 18, 2010

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  django/template/loader.py
6  django/template/loader.py
@@ -48,9 +48,9 @@ def load_template(self, template_name, template_dirs=None):
48 48
             template = get_template_from_string(source, origin, template_name)
49 49
             return template, None
50 50
         except TemplateDoesNotExist:
51  
-            # If compiling the template we found raises TemplateDoesNotExist, back off to 
  51
+            # If compiling the template we found raises TemplateDoesNotExist, back off to
52 52
             # returning the source and display name for the template we were asked to load.
53  
-            # This allows for correct identification (later) of the actual template that does 
  53
+            # This allows for correct identification (later) of the actual template that does
54 54
             # not exist.
55 55
             return source, display_name
56 56
 
@@ -85,7 +85,7 @@ def make_origin(display_name, loader, name, dirs):
85 85
         return None
86 86
 
87 87
 def find_template_loader(loader):
88  
-    if hasattr(loader, '__iter__'):
  88
+    if isinstance(loader, (tuple, list)):
89 89
         loader, args = loader[0], loader[1:]
90 90
     else:
91 91
         args = []

0 notes on commit 003fe52

Please sign in to comment.
Something went wrong with that request. Please try again.