diff options
author | Tim <tim@fewagainstmany.com> | 2012-11-25 20:54:24 -0800 |
---|---|---|
committer | Tim <tim@fewagainstmany.com> | 2012-11-25 20:54:24 -0800 |
commit | 4b812901ab3cbf556e71361796a6edf9b80e446c (patch) | |
tree | 06afd9f563b9477b5ba9e364cea793be55018532 /redis/client.py | |
parent | 7042051522b2d20afaa1b5a769586b42e19f3560 (diff) | |
download | redis-py-4b812901ab3cbf556e71361796a6edf9b80e446c.tar.gz |
Fixed bug in bitcount with start or end param equal to 0
Diffstat (limited to 'redis/client.py')
-rw-r--r-- | redis/client.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/redis/client.py b/redis/client.py index 9bf848c..f5a6283 100644 --- a/redis/client.py +++ b/redis/client.py @@ -500,10 +500,11 @@ class StrictRedis(object): ``start`` and ``end`` paramaters indicate which bytes to consider """ params = [key] - if start and end: + if start is not None and end is not None: params.append(start) params.append(end) - elif (start and not end) or (end and not start): + elif (start is not None and end is None) or \ + (end is not None and start is None): raise RedisError("Both start and end must be specified") return self.execute_command('BITCOUNT', *params) |