diff options
author | Alex Wang <aocheng@momenta.ai> | 2017-07-24 14:56:25 +0800 |
---|---|---|
committer | Alex Wang <aocheng@momenta.ai> | 2017-07-24 14:56:25 +0800 |
commit | 111327976ccb1e97ff2dfcc803a9505f5fe91577 (patch) | |
tree | 4954d7ae1b0c6d36c4457ea4f4d53607c30c26d5 | |
parent | 00068762423b5ad4db883dd6ea56ff7a3d200c2b (diff) | |
download | redis-py-111327976ccb1e97ff2dfcc803a9505f5fe91577.tar.gz |
[bugfix] Fix srandmember(key, 0) returns 1 element bug
-rwxr-xr-x | redis/client.py | 2 |
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): |