Ticket #4552: for_tag_re_split.patch

File for_tag_re_split.patch, 674 bytes (added by anonymous, 14 years ago)
  • django/template/defaulttags.py

     
    684684        raise TemplateSyntaxError("'for' statements should use the format"
    685685                                  " 'for x in y': %s" % token.contents)
    686686
    687     loopvars = re.sub(r' *, *', ',', ' '.join(bits[1:in_index])).split(',')
     687    loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
    688688    for var in loopvars:
    689689        if not var or ' ' in var:
    690690            raise TemplateSyntaxError("'for' tag received an invalid argument:"
Back to Top