diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2014-04-10 08:41:57 -0700 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2014-04-10 08:41:57 -0700 |
commit | 38135072b09eaad3e1569756b5deaf5ba4b5631c (patch) | |
tree | b64a80c491bfb75e7004b5da3a017cded3b1b3eb | |
parent | f49debc2cedb6fad04f81e79555e8b0ab467ab0f (diff) | |
download | redis-py-38135072b09eaad3e1569756b5deaf5ba4b5631c.tar.gz |
pull the encoding attrs directly off a connection. fixes #455
-rw-r--r-- | redis/client.py | 11 |
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): |