From abeb6c2904f7de3aa31efc1fed8ae413c15d9a75 Mon Sep 17 00:00:00 2001 From: NoneGG Date: Tue, 22 Aug 2017 22:57:13 +0800 Subject: [PATCH] fix bug of get_random_connection reported by myrfy001 --- aredis/pool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aredis/pool.py b/aredis/pool.py index 329ad1b1..32e4b1c6 100644 --- a/aredis/pool.py +++ b/aredis/pool.py @@ -411,7 +411,7 @@ def get_random_connection(self): Open new connection to random redis server. """ if self._available_connections: - node_name = random.choice(self._available_connections) + node_name = random.choice(list(self._available_connections.keys())) conn_list = self._available_connections[node_name] # check it in case of empty connection list if conn_list: