Django

Code

Changeset 7063

Show
Ignore:
Timestamp:
02/02/08 20:11:58 (7 months ago)
Author:
mtredinnick
Message:

Fixed #6359 -- Fixed an oversight in the debug output: template loaders need not have a get_source() method. Thanks, Guido van Rossum.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/views/debug.py

    r7057 r7063  
    193193    """ 
    194194    source = None 
    195     if loader is not None: 
    196         source = loader.get_source(module_name).splitlines() 
    197     else: 
     195    if loader is not None and hasattr(loader, "get_source"): 
     196        source = loader.get_source(module_name) 
     197        if source is not None: 
     198            source = source.splitlines() 
     199    if source is None: 
    198200        try: 
    199201            f = open(filename)