diff options
Diffstat (limited to 'mako/template.py')
-rw-r--r-- | mako/template.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mako/template.py b/mako/template.py index d32e465..acbf05e 100644 --- a/mako/template.py +++ b/mako/template.py @@ -663,7 +663,10 @@ def _compile_module_file(template, text, filename, outputpath, module_writer): shutil.move(name, outputpath) def _get_module_info_from_callable(callable_): - return _get_module_info(callable_.__globals__['__name__']) + if compat.py3k: + return _get_module_info(callable_.__globals__['__name__']) + else: + return _get_module_info(callable_.func_globals['__name__']) def _get_module_info(filename): return ModuleInfo._modules[filename] |