  
      reversed = bits[-1] == 'reversed'
      in_index = reversed and -3 or -2
      if bits[in_index] != 'in':
          raise TemplateSyntaxError, "'for' statements should use the format 'for x in y': %s" % token.contents
  
      loopvars = re.sub(r' *, *', ',', ' '.join(bits[1:in_index])).split(',')
      for var in loopvars:
          if not var or ' ' in var:
              raise TemplateSyntaxError, "'for' tag received an invalid argument: %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, "'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, "Invalid templatetag argument: '%s'. Must be one of: %s" % \
            (tag, TemplateTagNode.mapping.keys())
 </s> add         raise TemplateSyntaxError("Invalid templatetag argument: '%s'."
                                  " Must be one of: %s" %
                                  (tag, TemplateTagNode.mapping.keys())) </s> remove         raise TemplateSyntaxError, "%r expected format is 'value as name'" % bits[0]
 </s> add         raise TemplateSyntaxError("%r expected format is 'value as name'" %
                                  bits[0]) </s> remove             raise TemplateSyntaxError, "'%s' is not a valid tag library: %s" % (taglib, e)
 </s> add             raise TemplateSyntaxError("'%s' is not a valid tag library: %s" %
                                      (taglib, e))
        raise TemplateSyntaxError("'for' statements should use the format"
                                  " 'for x in y': %s" % token.contents)
  
      reversed = bits[-1] == 'reversed'
      in_index = reversed and -3 or -2
      if bits[in_index] != 'in':
        raise TemplateSyntaxError("'for' statements should use the format"
                                  " 'for x in y': %s" % token.contents)
  
      loopvars = re.sub(r' *, *', ',', ' '.join(bits[1:in_index])).split(',')
      for var in loopvars:
          if not var or ' ' in var:
              raise TemplateSyntaxError, "'for' tag received an invalid argument: %s" % token.contents
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