diff options
| author | alxasfuck <a.fittkau@posteo.de> | 2021-05-12 23:52:01 +0200 |
|---|---|---|
| committer | Andy McCurdy <andy@andymccurdy.com> | 2021-05-12 15:15:22 -0700 |
| commit | c7e26ae6749f63b9ebf65c023f270b2ea2b9536a (patch) | |
| tree | 9ea611232a168bd546b2281857b4b748e6afbc74 | |
| parent | 1a41cfd95a53a95b078084d8627be6b6fba3bb71 (diff) | |
| download | redis-py-c7e26ae6749f63b9ebf65c023f270b2ea2b9536a.tar.gz | |
Remove blocking behaviour from context manager __enter__
| -rw-r--r-- | redis/lock.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/redis/lock.py b/redis/lock.py index e36b2da..326dbaf 100644 --- a/redis/lock.py +++ b/redis/lock.py @@ -149,9 +149,7 @@ class Lock: client.register_script(cls.LUA_REACQUIRE_SCRIPT) def __enter__(self): - # force blocking, as otherwise the user would have to check whether - # the lock was actually acquired or not. - if self.acquire(blocking=True): + if self.acquire(): return self raise LockError("Unable to acquire lock within the time specified") |
