Permalink
Browse files

Updated to return the expected type on error

  • Loading branch information...
robhudson committed Nov 11, 2011
1 parent 8e5d954 commit ef7055a6c23e16cc1cbe16c3f5dd735a8728874f
Showing with 4 additions and 4 deletions.
  1. +4 −4 django_pylibmc/memcached.py
@@ -74,12 +74,12 @@ def add(self, key, value, timeout=None, version=None):
log.error('MemcachedError: %s' % e, exc_info=True)
return False
- def get(self, *args, **kwargs):
+ def get(self, key, default=None, version=None):
try:
- return super(PyLibMCCache, self).get(*args, **kwargs)
+ return super(PyLibMCCache, self).get(key, default, version)
except MemcachedError, e:
log.error('MemcachedError: %s' % e, exc_info=True)
- return False
+ return default
def set(self, key, value, timeout=None, version=None):
key = self.make_key(key, version=version)
@@ -107,7 +107,7 @@ def get_many(self, *args, **kwargs):
return super(PyLibMCCache, self).get_many(*args, **kwargs)
except MemcachedError, e:
log.error('MemcachedError: %s' % e, exc_info=True)
- return False
+ return {}
def set_many(self, *args, **kwargs):
try:

0 comments on commit ef7055a

Please sign in to comment.