diff options
Diffstat (limited to 'mako/exceptions.py')
-rw-r--r-- | mako/exceptions.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mako/exceptions.py b/mako/exceptions.py index 283391a..b6388b1 100644 --- a/mako/exceptions.py +++ b/mako/exceptions.py @@ -159,13 +159,17 @@ class RichTraceback(object): if not line: line = "" try: - (line_map, template_lines) = mods[filename] + (line_map, template_lines, template_filename) = mods[filename] except KeyError: try: info = mako.template._get_module_info(filename) module_source = info.code template_source = info.source - template_filename = info.template_filename or filename + template_filename = ( + info.template_filename + or info.template_uri + or filename + ) except KeyError: # A normal .py file (not a Template) if not compat.py3k: @@ -204,7 +208,7 @@ class RichTraceback(object): template_lines = [ line_ for line_ in template_source.split("\n") ] - mods[filename] = (line_map, template_lines) + mods[filename] = (line_map, template_lines, template_filename) template_ln = line_map[lineno - 1] |