summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2018-11-01 14:22:47 -0700
committerGitHub <noreply@github.com>2018-11-01 14:22:47 -0700
commitfc7ec59f1d63398ae2a05ee9a625d09ab089a120 (patch)
treed9124df37453d0e18364750f6aaa0926f6b720a3
parentc2227960548169c0f0549750e0a1f7bd0a126177 (diff)
parent39283c4b27367a7f93b4e0217e95ddc2e8dc6436 (diff)
downloadredis-py-fc7ec59f1d63398ae2a05ee9a625d09ab089a120.tar.gz
Merge pull request #1039 from jeffwidman/patch-2
"while 1" --> "while True"
-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 0cb6fca..b6c0da3 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -649,7 +649,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