Ticket #6578: template_simplify.patch

File template_simplify.patch, 887 bytes (added by Grzegorz Lukasik <hauserx@…>, 7 years ago)
  • template/__init__.py

     
    289289        return NodeList()
    290290
    291291    def extend_nodelist(self, nodelist, node, token):
    292         if node.must_be_first and nodelist:
    293             try:
    294                 if nodelist.contains_nontext:
    295                     raise AttributeError
    296             except AttributeError:
    297                 raise TemplateSyntaxError("%r must be the first tag in the template." % node)
     292        if node.must_be_first and nodelist and nodelist.contains_nontext:
     293            raise TemplateSyntaxError("%r must be the first tag in the template." % node)
    298294        if isinstance(nodelist, NodeList) and not isinstance(node, TextNode):
    299295            nodelist.contains_nontext = True
    300296        nodelist.append(node)
Back to Top