]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
force a reload of the template if bytecode fails to unmarshall. issue #281
authorTim Hanus <tim.hanus@adrevolution.com>
Thu, 21 Nov 2013 19:15:57 +0000 (13:15 -0600)
committerTim Hanus <tim.hanus@adrevolution.com>
Thu, 21 Nov 2013 19:15:57 +0000 (13:15 -0600)
jinja2/bccache.py

index f2f9db61b31c552e2ebac965004330ba9ff517b0..8ecbd4db29c5be9e630420908943f1e0793316cf 100644 (file)
@@ -85,7 +85,12 @@ class Bucket(object):
         if self.checksum != checksum:
             self.reset()
             return
-        self.code = marshal_load(f)
+        # if marshal_load fails then we need to reload
+        try:
+            self.code = marshal_load(f)
+        except:
+            self.reset()
+            return
 
     def write_bytecode(self, f):
         """Dump the bytecode into the file or file like object passed."""