diff --git a/redis/lock.py b/redis/lock.py index eea6c8b733..90f0e7af30 100644 --- a/redis/lock.py +++ b/redis/lock.py @@ -105,8 +105,8 @@ def acquire(self, blocking=None, blocking_timeout=None): if blocking_timeout is None: blocking_timeout = self.blocking_timeout stop_trying_at = None - if self.blocking_timeout is not None: - stop_trying_at = mod_time.time() + self.blocking_timeout + if blocking_timeout is not None: + stop_trying_at = mod_time.time() + blocking_timeout while 1: if self.do_acquire(token): self.local.token = token