Edgewall Software

Changes between Initial Version and Version 4 of Ticket #540


Ignore:
Timestamp:
Jan 25, 2013, 12:15:42 PM (11 years ago)
Author:
cboos
Comment:

I updated your test case with an expanded version, so that we can see the failure with released Python versions.

So first, when you say "hangs", I think you mean there's a test failure, which is much much less scary than a real "hang" of the process ;-)

I'm not exactly aware of the implementation details in Genshi, but to me it seems that such a regexp shouldn't match for ${{...}, so we can't use the newer PseudoToken and we should probably recompose the older one.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #540 – Description

    initial v4  
    2424
    2525{{{
     26#!py
    2627#!/usr/bin/python
    2728
     
    2930import unittest
    3031
    31 from tokenize import PseudoToken
     32from tokenize import (
     33    Whitespace, Number, Funny, ContStr, Name, Comment, Triple, group
     34)
    3235
    3336token_re = re.compile('%s|%s(?s)' % (
    3437    r'[uU]?[rR]?("""|\'\'\')((?<!\\)\\\1|.)*?\1',
    35     PseudoToken
    36 ))
     38    # PseudoToken =
     39    Whitespace + group(
     40        group(
     41            # PseudoExtras =
     42            # r'\\\r?\n',  # with this (< 2.7.4) it works
     43            r'\\\r?\n|\Z', # (>= 2.7.4)
     44            Comment, Triple),
     45        Number, Funny, ContStr, Name)
     46    ))
    3747
    3848class TestCase(unittest.TestCase):
     
    4252if __name__ == '__main__':
    4353    unittest.main()
     54
    4455}}}