Mercurial > genshi > mirror
comparison genshi/template/interpolation.py @ 991:0d4e1bafad8f stable-0.6.x
Merge r1213 from trunk (fix infinite loop in interpolation brace matching caused by a change in 2.7).
author | hodgestar |
---|---|
date | Sat, 26 Jan 2013 11:59:30 +0000 |
parents | f3d998cc941e |
children |
comparison
equal
deleted
inserted
replaced
984:8d4625183417 | 991:0d4e1bafad8f |
---|---|
113 yield False, text[pos:offset] | 113 yield False, text[pos:offset] |
114 pos = offset + 2 | 114 pos = offset + 2 |
115 level = 1 | 115 level = 1 |
116 while level: | 116 while level: |
117 match = token_re.match(text, pos) | 117 match = token_re.match(text, pos) |
118 if match is None: | 118 if match is None or not match.group(): |
119 # if there isn't a match or the match is the empty | |
120 # string, we're not going to match up braces ever | |
119 raise TemplateSyntaxError('invalid syntax', filepath, | 121 raise TemplateSyntaxError('invalid syntax', filepath, |
120 *textpos[1:]) | 122 *textpos[1:]) |
121 pos = match.end() | 123 pos = match.end() |
122 tstart, tend = match.regs[3] | 124 tstart, tend = match.regs[3] |
123 token = text[tstart:tend] | 125 token = text[tstart:tend] |