diff options
Diffstat (limited to 'redis/lock.py')
-rw-r--r-- | redis/lock.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/redis/lock.py b/redis/lock.py index c6fd01d..38ab0bf 100644 --- a/redis/lock.py +++ b/redis/lock.py @@ -1,7 +1,7 @@ import threading import time as mod_time import uuid -from redis.exceptions import LockError +from redis.exceptions import LockError, LockErrorNotOwned from redis.utils import dummy @@ -190,7 +190,8 @@ class Lock(object): if not bool(self.lua_release(keys=[self.name], args=[expected_token], client=self.redis)): - raise LockError("Cannot release a lock that's no longer owned") + raise LockErrorNotOwned("Cannot release a lock" + " that's no longer owned") def extend(self, additional_time): """ @@ -210,5 +211,6 @@ class Lock(object): if not bool(self.lua_extend(keys=[self.name], args=[self.local.token, additional_time], client=self.redis)): - raise LockError("Cannot extend a lock that's no longer owned") + raise LockErrorNotOwned("Cannot extend a lock that's" + " no longer owned") return True |