aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mako/template.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-12-14 02:29:15 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-12-14 02:29:15 +0000
commit734c5bf49810ebfc52265adfdae072631e614c16 (patch)
tree5c1fac750e7159738bdcf0b5eea1775b0a16dadd /lib/mako/template.py
parent03011540d4e6dfb2133849ec0d8faff8d27ebec1 (diff)
downloadexternal_python_mako-734c5bf49810ebfc52265adfdae072631e614c16.tar.gz
external_python_mako-734c5bf49810ebfc52265adfdae072631e614c16.tar.bz2
external_python_mako-734c5bf49810ebfc52265adfdae072631e614c16.zip
magic number support
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