Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #6359 -- Fixed an oversight in the debug output: template loade…

…rs need not have a get_source() method. Thanks, Guido van Rossum.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7063 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 8ce7d4740e88fe38a290aa12257204065393b5ba 1 parent 2542b94
Malcolm Tredinnick malcolmt authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 django/views/debug.py
8 django/views/debug.py
View
@@ -192,9 +192,11 @@ def _get_lines_from_file(filename, lineno, context_lines, loader=None, module_na
Returns (pre_context_lineno, pre_context, context_line, post_context).
"""
source = None
- if loader is not None:
- source = loader.get_source(module_name).splitlines()
- else:
+ if loader is not None and hasattr(loader, "get_source"):
+ source = loader.get_source(module_name)
+ if source is not None:
+ source = source.splitlines()
+ if source is None:
try:
f = open(filename)
try:
Please sign in to comment.
Something went wrong with that request. Please try again.