summaryrefslogtreecommitdiff
path: root/redis/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'redis/client.py')
-rw-r--r--redis/client.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/redis/client.py b/redis/client.py
index 27162f6..39dcdab 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -1887,10 +1887,13 @@ class PubSub(object):
self.connection = None
# we need to know the encoding options for this connection in order
# to lookup channel and pattern names for callback handlers.
- connection_kwargs = self.connection_pool.connection_kwargs
- self.encoding = connection_kwargs['encoding']
- self.encoding_errors = connection_kwargs['encoding_errors']
- self.decode_responses = connection_kwargs['decode_responses']
+ conn = connection_pool.get_connection('pubsub', shard_hint)
+ try:
+ self.encoding = conn.encoding
+ self.encoding_errors = conn.encoding_errors
+ self.decode_responses = conn.decode_responses
+ finally:
+ connection_pool.release(conn)
self.reset()
def __del__(self):