Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@freakboy3742 freakboy3742 authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 django/template/loader.py
View
6 django/template/loader.py
@@ -48,9 +48,9 @@ def load_template(self, template_name, template_dirs=None):
template = get_template_from_string(source, origin, template_name)
return template, None
except TemplateDoesNotExist:
- # If compiling the template we found raises TemplateDoesNotExist, back off to
+ # If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
- # This allows for correct identification (later) of the actual template that does
+ # This allows for correct identification (later) of the actual template that does
# not exist.
return source, display_name
@@ -85,7 +85,7 @@ def make_origin(display_name, loader, name, dirs):
return None
def find_template_loader(loader):
- if hasattr(loader, '__iter__'):
+ if isinstance(loader, (tuple, list)):
loader, args = loader[0], loader[1:]
else:
args = []
Please sign in to comment.
Something went wrong with that request. Please try again.