Browse files

Fixed #10216. Only try to gather template exception info if the excep…

…tion is a Django TemplateSyntaxError. Thanks, Alex Gaynor.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent dc1ad69 commit 83e52e316225650467ebbee2d86eff7bd5b566e7 @jkocherhans jkocherhans committed Feb 24, 2010
Showing with 7 additions and 4 deletions.
  1. +7 −4 django/views/
@@ -1,15 +1,17 @@
+import datetime
import os
import re
import sys
-import datetime
from django.conf import settings
-from django.template import Template, Context, TemplateDoesNotExist
+from django.http import HttpResponse, HttpResponseServerError, HttpResponseNotFound
+from django.template import (Template, Context, TemplateDoesNotExist,
+ TemplateSyntaxError)
from django.utils.html import escape
from django.utils.importlib import import_module
-from django.http import HttpResponse, HttpResponseServerError, HttpResponseNotFound
from django.utils.encoding import smart_unicode, smart_str
def linebreak_iter(template_source):
@@ -100,7 +102,8 @@ def get_traceback_html(self):
'loader': loader_name,
'templates': template_list,
- if settings.TEMPLATE_DEBUG and hasattr(self.exc_value, 'source'):
+ if (settings.TEMPLATE_DEBUG and hasattr(self.exc_value, 'source') and
+ isinstance(self.exc_value, TemplateSyntaxError)):
frames = self.get_traceback_frames()

0 comments on commit 83e52e3

Please sign in to comment.