summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Wang <aocheng@momenta.ai>2017-07-24 14:56:25 +0800
committerAlex Wang <aocheng@momenta.ai>2017-07-24 14:56:25 +0800
commit111327976ccb1e97ff2dfcc803a9505f5fe91577 (patch)
tree4954d7ae1b0c6d36c4457ea4f4d53607c30c26d5
parent00068762423b5ad4db883dd6ea56ff7a3d200c2b (diff)
downloadredis-py-111327976ccb1e97ff2dfcc803a9505f5fe91577.tar.gz
[bugfix] Fix srandmember(key, 0) returns 1 element bug
-rwxr-xr-xredis/client.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/redis/client.py b/redis/client.py
index 1a8589d..92095de 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -1644,7 +1644,7 @@ class StrictRedis(object):
memebers of set ``name``. Note this is only available when running
Redis 2.6+.
"""
- args = number and [number] or []
+ args = (number is not None) and [number] or []
return self.execute_command('SRANDMEMBER', name, *args)
def srem(self, name, *values):