Permalink
Browse files

Merge pull request #882 from a1exwang/master

[bugfix] Fix srandmember(key, 0) returns 1 element bug
2 parents 0006876 + 1113279 commit 0adba8081b0caf5150cdc2f5ca0111207eb130a0 @andymccurdy committed on GitHub Jul 24, 2017
Showing with 1 addition and 1 deletion.
  1. +1 −1 redis/client.py
View
@@ -1644,7 +1644,7 @@ def srandmember(self, name, number=None):
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):

0 comments on commit 0adba80

Please sign in to comment.