diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2017-07-31 16:05:01 -0400 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2017-07-31 16:05:01 -0400 |
commit | 5dced57b6c74b7a7d2342ff705fa239dfa5a2597 (patch) | |
tree | 3d97f3f29eded71dd31a960fc33699af7d644358 /redis/client.py | |
parent | a3502de93b5d74b28a1a8952515b5775b14c653f (diff) | |
download | redis-py-5dced57b6c74b7a7d2342ff705fa239dfa5a2597.tar.gz |
added get_encoding() to ConnectionPool
Diffstat (limited to 'redis/client.py')
-rwxr-xr-x | redis/client.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/redis/client.py b/redis/client.py index 4bab5fb..e72c1b1 100755 --- a/redis/client.py +++ b/redis/client.py @@ -2338,13 +2338,10 @@ 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. - 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) + encoding_options = self.connection_pool.get_encoding() + self.encoding = encoding_options['encoding'] + self.encoding_errors = encoding_options['encoding_errors'] + self.decode_responses = encoding_options['decode_responses'] self.reset() def __del__(self): |