Commit 8ce7d474 authored by Malcolm Tredinnick's avatar Malcolm Tredinnick
Browse files

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

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
parent 2542b94f
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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: