Commits

armada  committed 588638a

Pickle remove

  • Participants
  • Parent commits 6088f26

Comments (0)

Files changed (1)

File mongodb_cache/__init__.py

 "Base Cache class."
 import pymongo
 from datetime import datetime, timedelta
-try:
-    import cPickle as pickle
-except ImportError:
-    import pickle
 import logging
 
 from django.core.exceptions import ImproperlyConfigured
         """
 
         key = smart_str(key)
-        value = pickle.dumps(value)
         try:
             obj = {'key': key, 'value': value, 'expired': self.expired(timeout)}
             self._cache.save(obj, safe=True)
             else:
                 if self.debug:
                     logger.info('Success cache hit for key: %s' % key)
-                value = pickle.loads(obj['value'].encode('utf-8'))
+                value = obj['value']
                 if isinstance(value, basestring):
                     return smart_unicode(value)
                 else:
 
         key = smart_str(key)
         if not self.add(key, value, timeout):
-            value = pickle.dumps(value)
             obj = {'key': key, 'value': value, 'expired': self.expired(timeout)}
             self._cache.update({'key': key}, obj)