summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--memcache.py3
2 files changed, 5 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index be431b5..c4d03d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+ * Allow empty server list, patch by zewt on github.
+
* If unknown flags in get request, raises a value error rather than the
code bombing out.
diff --git a/memcache.py b/memcache.py
index f0f7777..8031929 100644
--- a/memcache.py
+++ b/memcache.py
@@ -352,6 +352,9 @@ class Client(local):
else:
serverhash = serverHashFunction(key)
+ if not self.buckets:
+ return None, None
+
for i in range(Client._SERVER_RETRIES):
server = self.buckets[serverhash % len(self.buckets)]
if server.connect():