Django

Code

Changeset 1385

Show
Ignore:
Timestamp:
11/23/05 18:06:36 (3 years ago)
Author:
hugo
Message:

changed the linebreaks_iter function to use str.find instead of re.finditer, because the latter one has problems with Python 2.3

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/views/debug.py

    r1381 r1385  
    1010 
    1111def linebreak_iter(template_source): 
    12     newline_re = re.compile("^", re.M) 
    13     for match in newline_re.finditer(template_source): 
    14         yield match.start() 
     12    p = template_source.find('\n') 
     13    while p >= 0: 
     14        yield p 
     15        p = template_source.find('\n', p+1) 
    1516    yield len(template_source) + 1 
    1617