Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

changed the linebreaks_iter function to use str.find instead of re.fi…

…nditer, 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
  • Loading branch information...
commit eab4a2259657ec1193b3ea2fcdcdf3a4371397d8 1 parent 140f4a6
Georg Bauer authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 django/views/debug.py
View
9 django/views/debug.py
@@ -9,9 +9,10 @@
HIDDEN_SETTINGS = re.compile('SECRET|PASSWORD')
def linebreak_iter(template_source):
- newline_re = re.compile("^", re.M)
- for match in newline_re.finditer(template_source):
- yield match.start()
+ p = template_source.find('\n')
+ while p >= 0:
+ yield p
+ p = template_source.find('\n', p+1)
yield len(template_source) + 1
def get_template_exception_info(exc_type, exc_value, tb):
@@ -519,4 +520,4 @@ def _get_lines_from_file(filename, lineno, context_lines):
</div>
</body>
</html>
-"""
+"""
Please sign in to comment.
Something went wrong with that request. Please try again.