diff options
author | Jeff Widman <jeff@jeffwidman.com> | 2018-10-11 22:54:57 -0700 |
---|---|---|
committer | Jeff Widman <jeff@jeffwidman.com> | 2018-10-11 23:02:01 -0700 |
commit | 39283c4b27367a7f93b4e0217e95ddc2e8dc6436 (patch) | |
tree | aef708a0fac9ad9ef0f54870c0c402e93af1d5cf | |
parent | 0d6c5f28ef87c83df5540abc358252cae3d2060e (diff) | |
download | redis-py-39283c4b27367a7f93b4e0217e95ddc2e8dc6436.tar.gz |
"while 1" --> "while True"
This is python, not C
-rw-r--r-- | README.rst | 4 | ||||
-rwxr-xr-x | redis/client.py | 2 | ||||
-rw-r--r-- | redis/lock.py | 2 |
3 files changed, 4 insertions, 4 deletions
@@ -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 |