Ticket #12178: raw.diff
File raw.diff, 703 bytes (added by , 15 years ago) |
---|
-
memcached.py
21 21 value = value.encode('utf-8') 22 22 return self._cache.add(smart_str(key), value, timeout or self.default_timeout) 23 23 24 def get(self, key, default=None ):24 def get(self, key, default=None, raw=False): 25 25 val = self._cache.get(smart_str(key)) 26 26 if val is None: 27 27 return default 28 28 else: 29 if isinstance(val, basestring) :29 if isinstance(val, basestring) and not raw: 30 30 return smart_unicode(val) 31 31 else: 32 32 return val