summaryrefslogtreecommitdiff
path: root/redis/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'redis/client.py')
-rwxr-xr-xredis/client.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/redis/client.py b/redis/client.py
index d6bd5c3..d84c8b3 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -2226,6 +2226,10 @@ class PubSub(object):
def parse_response(self, block=True, timeout=0):
"Parse the response from a publish/subscribe command"
connection = self.connection
+ if connection is None:
+ raise RuntimeError(
+ 'pubsub connection not set: '
+ 'did you forget to call subscribe() or psubscribe()?')
if not block and not connection.can_read(timeout=timeout):
return None
return self._execute(connection, connection.read_response)