Commits

Lx Yu committed 2e55041

use the best protocol for pickle

Comments (0)

Files changed (1)

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())