summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2017-05-08 14:06:24 -0400
committerGitHub <noreply@github.com>2017-05-08 14:06:24 -0400
commitd6c300b39ab4c81cd97b81fcd8d25a9cde9476e7 (patch)
tree2dc899ca3160e9e4bad2bd4b0a6bff3c4ba856f8
parent3db001461ce3ed749eb863bd3dee37938bc09fe7 (diff)
parent3d328faa2f4015ee8c1f99dfd7ff727cf25eb913 (diff)
downloadredis-py-d6c300b39ab4c81cd97b81fcd8d25a9cde9476e7.tar.gz
Merge pull request #848 from hqy/master
fixed can't raise invalid expire time when set ex param is 0
-rwxr-xr-xredis/client.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/redis/client.py b/redis/client.py
index d7608aa..98764ca 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -1150,12 +1150,12 @@ class StrictRedis(object):
already exists.
"""
pieces = [name, value]
- if ex:
+ if ex is not None:
pieces.append('EX')
if isinstance(ex, datetime.timedelta):
ex = ex.seconds + ex.days * 24 * 3600
pieces.append(ex)
- if px:
+ if px is not None:
pieces.append('PX')
if isinstance(px, datetime.timedelta):
ms = int(px.microseconds / 1000)