mirror of https://github.com/django/django.git
changed the linebreaks_iter function to use str.find instead of re.finditer, because the latter one has problems with Python 2.3
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1385 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
140f4a6913
commit
eab4a22596
|
@ -9,9 +9,10 @@ from os.path import dirname, join as pathjoin
|
||||||
HIDDEN_SETTINGS = re.compile('SECRET|PASSWORD')
|
HIDDEN_SETTINGS = re.compile('SECRET|PASSWORD')
|
||||||
|
|
||||||
def linebreak_iter(template_source):
|
def linebreak_iter(template_source):
|
||||||
newline_re = re.compile("^", re.M)
|
p = template_source.find('\n')
|
||||||
for match in newline_re.finditer(template_source):
|
while p >= 0:
|
||||||
yield match.start()
|
yield p
|
||||||
|
p = template_source.find('\n', p+1)
|
||||||
yield len(template_source) + 1
|
yield len(template_source) + 1
|
||||||
|
|
||||||
def get_template_exception_info(exc_type, exc_value, tb):
|
def get_template_exception_info(exc_type, exc_value, tb):
|
||||||
|
|
Loading…
Reference in New Issue