Commit d739c23e authored by Jannis Leidel's avatar Jannis Leidel Committed by Sean Bleier

Simplify get() slightly.

parent fc404efa
...@@ -47,17 +47,17 @@ class CacheClass(BaseCache): ...@@ -47,17 +47,17 @@ class CacheClass(BaseCache):
if value is None: if value is None:
return default return default
else:
# picke doesn't want a unicode!
value = smart_str(value)
# hydrate that pickle # picke doesn't want a unicode!
value = pickle.loads(value.decode('base64')) value = smart_str(value)
# hydrate that pickle
value = pickle.loads(value.decode('base64'))
if isinstance(value, basestring): if isinstance(value, basestring):
return smart_unicode(value) return smart_unicode(value)
else: else:
return value return value
def set(self, key, value, timeout=None): def set(self, key, value, timeout=None):
"Persist a value to the cache, and set an optional expiration time." "Persist a value to the cache, and set an optional expiration time."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment