Skip to content

Commit

Permalink
Fixed #13123 -- Cleaned up template loader for PyPy compatibility. Th…
Browse files Browse the repository at this point in the history
…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
freakboy3742 committed Mar 18, 2010
1 parent 10de2a8 commit 003fe52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions django/template/loader.py
Expand Up @@ -48,9 +48,9 @@ def load_template(self, template_name, template_dirs=None):
template = get_template_from_string(source, origin, template_name) template = get_template_from_string(source, origin, template_name)
return template, None return template, None
except TemplateDoesNotExist: 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. # 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. # not exist.
return source, display_name return source, display_name


Expand Down Expand Up @@ -85,7 +85,7 @@ def make_origin(display_name, loader, name, dirs):
return None return None


def find_template_loader(loader): def find_template_loader(loader):
if hasattr(loader, '__iter__'): if isinstance(loader, (tuple, list)):
loader, args = loader[0], loader[1:] loader, args = loader[0], loader[1:]
else: else:
args = [] args = []
Expand Down

0 comments on commit 003fe52

Please sign in to comment.