          {% endwith %}
      """
      bits = list(token.split_contents())
      if len(bits) != 4 or bits[2] != "as":
          raise TemplateSyntaxError, "%r expected format is 'value as name'" % bits[0]
      var = parser.compile_filter(bits[1])
      name = bits[3]
      nodelist = parser.parse(('endwith',))
      parser.delete_first_token()
      return WithNode(var, name, nodelist)
 
</s> remove         raise TemplateSyntaxError, "'for' statements should have at least four words: %s" % token.contents
 </s> add         raise TemplateSyntaxError("'for' statements should have at least four"
                                  " words: %s" % token.contents) </s> remove         raise TemplateSyntaxError, "'for' statements should use the format 'for x in y': %s" % token.contents
 </s> add         raise TemplateSyntaxError("'for' statements should use the format"
                                  " 'for x in y': %s" % token.contents) </s> remove             raise TemplateSyntaxError, "'for' tag received an invalid argument: %s" % token.contents
 </s> add             raise TemplateSyntaxError("'for' tag received an invalid argument:"
                                      " %s" % token.contents) </s> remove         raise TemplateSyntaxError, "'ssi' tag takes one argument: the path to the file to be included"
 </s> add         raise TemplateSyntaxError("'ssi' tag takes one argument: the path to"
                                  " the file to be included") </s> remove             raise TemplateSyntaxError, "Second (optional) argument to %s tag must be 'parsed'" % bits[0]
 </s> add             raise TemplateSyntaxError("Second (optional) argument to %s tag"
                                      " must be 'parsed'" % bits[0])
        raise TemplateSyntaxError("%r expected format is 'value as name'" %
                                  bits[0])
          {% endwith %}
      """
      bits = list(token.split_contents())
      if len(bits) != 4 or bits[2] != "as":
        raise TemplateSyntaxError("%r expected format is 'value as name'" %
                                  bits[0])
      var = parser.compile_filter(bits[1])
      name = bits[3]
      nodelist = parser.parse(('endwith',))
      parser.delete_first_token()
      return WithNode(var, name, nodelist)
keep keep keep keep replace keep keep keep keep keep
 Style and import fixes.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6641 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/template/defaulttags.py