summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralxasfuck <a.fittkau@posteo.de>2021-05-12 23:52:01 +0200
committerAndy McCurdy <andy@andymccurdy.com>2021-05-12 15:15:22 -0700
commitc7e26ae6749f63b9ebf65c023f270b2ea2b9536a (patch)
tree9ea611232a168bd546b2281857b4b748e6afbc74
parent1a41cfd95a53a95b078084d8627be6b6fba3bb71 (diff)
downloadredis-py-c7e26ae6749f63b9ebf65c023f270b2ea2b9536a.tar.gz
Remove blocking behaviour from context manager __enter__
-rw-r--r--redis/lock.py4
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")