aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mako/template.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mako/template.py')
-rw-r--r--lib/mako/template.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/mako/template.py b/lib/mako/template.py
index 9dd895c..ebda549 100644
--- a/lib/mako/template.py
+++ b/lib/mako/template.py
@@ -59,6 +59,10 @@ class Template(object):
_compile_module_file(file(filename).read(), self.module_id, filename, path, self.uri)
module = imp.load_source(self.module_id, path, file(path))
del sys.modules[self.module_id]
+ if module._magic_number != codegen.MAGIC_NUMBER:
+ _compile_module_file(file(filename).read(), self.module_id, filename, path, self.uri)
+ module = imp.load_source(self.module_id, path, file(path))
+ del sys.modules[self.module_id]
ModuleInfo(module, path, self, filename, None, None)
else:
# template filename and no module directory, compile code