Edgewall Software

Changeset 1213 for trunk


Ignore:
Timestamp:
Jan 26, 2013, 12:53:36 PM (11 years ago)
Author:
hodgestar
Message:

Stop try to lex for matching braces in interpolation if the token_re matches an empty string. This fixes the infinite loop triggered by the test suite as a result of the change to Python 2.7 describe in http://bugs.python.org/issue16152 and reported in http://genshi.edgewall.org/ticket/540.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/genshi/template/interpolation.py

    r1082 r1213  
    116116            while level:
    117117                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
    119121                    raise TemplateSyntaxError('invalid syntax',  filepath,
    120122                                              *textpos[1:])
Note: See TracChangeset for help on using the changeset viewer.