Added filesize part to the module compiler. This fixes #131 for 3.3 and later
authorArmin Ronacher <armin.ronacher@active-4.com>
Sat, 15 Sep 2012 23:26:31 +0000 (08:26 +0900)
committerArmin Ronacher <armin.ronacher@active-4.com>
Sat, 15 Sep 2012 23:26:31 +0000 (08:26 +0900)
jinja2/environment.py

index ebb54548e3ef901f6606863778f32572c5f2ba44..130f9a16a4b53035be75bf69cb5ca8a258080d70 100644 (file)
@@ -570,6 +570,10 @@ class Environment(object):
             py_header = imp.get_magic() + \
                 u'\xff\xff\xff\xff'.encode('iso-8859-15')
 
+            # Python 3.3 added a source filesize to the header
+            if sys.version_info >= (3, 3):
+                py_header += '\x00\x00\x00\x00'
+
         def write_file(filename, data, mode):
             if zip:
                 info = ZipInfo(filename)