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):
if value is None:
return default
else:
# picke doesn't want a unicode!
value = smart_str(value)
# hydrate that pickle
value = pickle.loads(value.decode('base64'))
# picke doesn't want a unicode!
value = smart_str(value)
# hydrate that pickle
value = pickle.loads(value.decode('base64'))
if isinstance(value, basestring):
return smart_unicode(value)
else:
return value
if isinstance(value, basestring):
return smart_unicode(value)
else:
return value
def set(self, key, value, timeout=None):
"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