Kaydet (Commit) 8ce7d474 authored tarafından Malcolm Tredinnick's avatar Malcolm Tredinnick

Fixed #6359 -- Fixed an oversight in the debug output: template loaders need not…

Fixed #6359 -- Fixed an oversight in the debug output: template loaders 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
üst 2542b94f
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment