summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Widman <jeff@jeffwidman.com>2018-10-11 22:54:57 -0700
committerJeff Widman <jeff@jeffwidman.com>2018-10-11 23:02:01 -0700
commit39283c4b27367a7f93b4e0217e95ddc2e8dc6436 (patch)
treeaef708a0fac9ad9ef0f54870c0c402e93af1d5cf
parent0d6c5f28ef87c83df5540abc358252cae3d2060e (diff)
downloadredis-py-39283c4b27367a7f93b4e0217e95ddc2e8dc6436.tar.gz
"while 1" --> "while True"
This is python, not C
-rw-r--r--README.rst4
-rwxr-xr-xredis/client.py2
-rw-r--r--redis/lock.py2
3 files changed, 4 insertions, 4 deletions
diff --git a/README.rst b/README.rst
index a21c13a..0efafc7 100644
--- a/README.rst
+++ b/README.rst
@@ -276,7 +276,7 @@ could do something like this:
.. code-block:: pycon
>>> with r.pipeline() as pipe:
- ... while 1:
+ ... while True:
... try:
... # put a WATCH on the key that holds our sequence value
... pipe.watch('OUR-SEQUENCE-KEY')
@@ -309,7 +309,7 @@ explicitly calling reset():
.. code-block:: pycon
>>> pipe = r.pipeline()
- >>> while 1:
+ >>> while True:
... try:
... pipe.watch('OUR-SEQUENCE-KEY')
... ...
diff --git a/redis/client.py b/redis/client.py
index 79e94d0..27d5eff 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -579,7 +579,7 @@ class StrictRedis(object):
value_from_callable = kwargs.pop('value_from_callable', False)
watch_delay = kwargs.pop('watch_delay', None)
with self.pipeline(True, shard_hint) as pipe:
- while 1:
+ while True:
try:
if watches:
pipe.watch(*watches)
diff --git a/redis/lock.py b/redis/lock.py
index 732568b..bc7e850 100644
--- a/redis/lock.py
+++ b/redis/lock.py
@@ -107,7 +107,7 @@ class Lock(object):
stop_trying_at = None
if blocking_timeout is not None:
stop_trying_at = mod_time.time() + blocking_timeout
- while 1:
+ while True:
if self.do_acquire(token):
self.local.token = token
return True