changeset 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 8d4625183417
children f2d1f04b0959
files genshi/template/interpolation.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/genshi/template/interpolation.py
+++ b/genshi/template/interpolation.py
@@ -115,7 +115,9 @@
             level = 1
             while level:
                 match = token_re.match(text, pos)
-                if match is None:
+                if match is None or not match.group():
+                    # if there isn't a match or the match is the empty
+                    # string, we're not going to match up braces ever
                     raise TemplateSyntaxError('invalid syntax',  filepath,
                                               *textpos[1:])
                 pos = match.end()
Copyright (C) 2012-2017 Edgewall Software