summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorBas Peschier <basp@fabrique.nl>2013-02-24 13:36:04 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-02-24 13:56:15 +0100
commit5a9b2bce242bd2f8a9fed6ac735406ce68b10738 (patch)
tree2fde6669666d644ff1732d70ac7d5a61ace7d89d /django
parentd7e835f76d81d66a6d8964dba20506a1c6e559d8 (diff)
Fixed #19810 -- MemcachedCache now uses pickle.HIGHEST_PROTOCOL
Diffstat (limited to 'django')
-rw-r--r--django/core/cache/backends/memcached.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django/core/cache/backends/memcached.py b/django/core/cache/backends/memcached.py
index f8dcf983af..c942acd52f 100644
--- a/django/core/cache/backends/memcached.py
+++ b/django/core/cache/backends/memcached.py
@@ -1,6 +1,7 @@
"Memcached cache backend"
import time
+import pickle
from threading import local
from django.core.cache.backends.base import BaseCache, InvalidCacheBackendError
@@ -146,6 +147,12 @@ class MemcachedCache(BaseMemcachedCache):
library=memcache,
value_not_found_exception=ValueError)
+ @property
+ def _cache(self):
+ if getattr(self, '_client', None) is None:
+ self._client = self._lib.Client(self._servers, pickleProtocol=pickle.HIGHEST_PROTOCOL)
+ return self._client
+
class PyLibMCCache(BaseMemcachedCache):
"An implementation of a cache binding using pylibmc"
def __init__(self, server, params):