Ticket #13049: extends_template.diff
File extends_template.diff, 1.8 KB (added by , 15 years ago) |
---|
-
django/template/loader_tags.py
99 99 return parent # parent is a Template object 100 100 try: 101 101 return get_template(parent) 102 except TemplateDoesNotExist: 103 raise TemplateSyntaxError("Template %r cannot be extended, because it doesn't exist" % parent) 102 except TemplateDoesNotExist, e: 103 if e.message == parent: 104 raise TemplateSyntaxError("Template %r cannot be extended, because it doesn't exist" % parent) 105 else: 106 raise 104 107 105 108 def render(self, context): 106 109 compiled_parent = self.get_parent(context) -
django/template/debug.py
1 from django.template import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError 1 from django.template import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError, TemplateDoesNotExist 2 2 from django.utils.encoding import force_unicode 3 3 from django.utils.html import escape 4 4 from django.utils.safestring import SafeData, EscapeData … … 74 74 if not hasattr(e, 'source'): 75 75 e.source = node.source 76 76 raise 77 except TemplateDoesNotExist, e: 78 if not hasattr(e, 'source'): 79 e.source = node.source 80 raise 77 81 except Exception, e: 78 82 from sys import exc_info 79 83 wrapped = TemplateSyntaxError(u'Caught an exception while rendering: %s' % force_unicode(e, errors='replace'))