summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Despoudis <thdespou@hotmail.com>2018-12-04 15:30:39 +0000
committerTheo Despoudis <thdespou@hotmail.com>2018-12-04 15:30:39 +0000
commitf91a9d522af9eb808f4b692a5fe24d70431ac8c3 (patch)
tree3a58b0ec00d6f30c8a687e65e5f9e4aad6de01d6
parent1861986a39f8658150eaa8a61b367e50c7145355 (diff)
downloadredis-py-f91a9d522af9eb808f4b692a5fe24d70431ac8c3.tar.gz
Simplified key, value handling inside for-range loop
Signed-off-by: Theo Despoudis <thdespou@hotmail.com>
-rwxr-xr-xredis/client.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/redis/client.py b/redis/client.py
index 035c56c..c329ea9 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -808,13 +808,12 @@ class Redis(object):
client_types = ('normal', 'master', 'slave', 'pubsub')
yes_no = ('yes', 'no')
for index in range(0, len(filter_options), 2):
- option = filter_options[index]
- value = filter_options[index + 1]
- key = str(option).lower()
+ key = str(filter_options[index]).lower()
+ value = str(filter_options[index + 1]).lower()
if key not in filter_types:
raise DataError("CLIENT KILL <filter> must be one of %r" % (
filter_types,))
- if key == 'type' and option not in client_types:
+ if key == 'type' and value not in client_types:
raise DataError("CLIENT KILL TYPE <value> must be one of %r" % (
client_types,))
if key == 'skipme' and value not in yes_no: