# HG changeset patch
# User btimby
# Date 1337478551 0
# Node ID 4ad156c4dbeeb8dd237941335f9db96aa205cd86
# Parent  9805eefcb58c7cf9901f9a432b87cee119a1aa1f
blpop returns a tuple (queue_name, item) on success, on timeout, None, we need to handle both cases.

diff -r 9805eefcb58c -r 4ad156c4dbee queues/backends/redisd.py
--- a/queues/backends/redisd.py	Sun May 20 01:08:16 2012 +0000
+++ b/queues/backends/redisd.py	Sun May 20 01:49:11 2012 +0000
@@ -70,7 +70,10 @@
             if block:
                 # Redis requires an integer, so round a float UP to the nearest
                 # int (0.1 -> 1).
-                m = self._connection.blpop(self.name, timeout=int(math.ceil(timeout)))
+                try:
+                    m = self._connection.blpop(self.name, timeout=int(math.ceil(timeout)))[1]
+                except TypeError:
+                    m = None
             else:
                 m = self._connection.lpop(self.name)
             if m is None: