summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/views/debug.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/django/views/debug.py b/django/views/debug.py
index 47b51f73e1..6d90633de6 100644
--- a/django/views/debug.py
+++ b/django/views/debug.py
@@ -9,9 +9,10 @@ from os.path import dirname, join as pathjoin
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 @@ TECHNICAL_404_TEMPLATE = """
</div>
</body>
</html>
-""" \ No newline at end of file
+"""