Skip to content

Commit

Permalink
Fixed #6423 -- Don't fall in a hole in the debug screen if somebody r…
Browse files Browse the repository at this point in the history
…aises an old-fashioned string exception. Thanks, guettli.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7065 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Feb 3, 2008
1 parent 8b29767 commit 787acef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions django/views/debug.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ def technical_500_response(request, exc_type, exc_value, tb):
template_info = None template_info = None
template_does_not_exist = False template_does_not_exist = False
loader_debug_info = None loader_debug_info = None

# Handle deprecated string exceptions
if isinstance(exc_type, basestring):
exc_value = Exception('Deprecated String Exception: %r' % exc_type)
exc_type = type(exc_value)

if issubclass(exc_type, TemplateDoesNotExist): if issubclass(exc_type, TemplateDoesNotExist):
from django.template.loader import template_source_loaders from django.template.loader import template_source_loaders
template_does_not_exist = True template_does_not_exist = True
Expand Down

0 comments on commit 787acef

Please sign in to comment.