Commits

Mike Bayer committed 9f54406 Merge

Merged in lxyu/dogpile.cache/better_pickle (pull request #26)

Use highest protocol for pickle

  • Participants
  • Parent commits 40a01e2, 2e55041

Comments (0)

Files changed (1)

File dogpile/cache/backends/redis.py

     def set(self, key, value):
         if self.redis_expiration_time:
             self.client.setex(key, self.redis_expiration_time,
-                              pickle.dumps(value))
+                              pickle.dumps(value, pickle.HIGHEST_PROTOCOL))
         else:
-            self.client.set(key, pickle.dumps(value))
+            self.client.set(key, pickle.dumps(value, pickle.HIGHEST_PROTOCOL))
 
     def set_multi(self, mapping):
         mapping = dict((k, pickle.dumps(v)) for k, v in mapping.items())