Skip to content

Commit a5ae4e3

Browse files
authored
Merge branch 'master' into dependabot/github_actions/rojopolis/spellcheck-github-actions-0.47.0
2 parents 294ef72 + 2fb2f47 commit a5ae4e3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

redis/asyncio/lock.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,10 @@ def release(self) -> Awaitable[None]:
249249
"""Releases the already acquired lock"""
250250
expected_token = self.local.token
251251
if expected_token is None:
252-
raise LockError("Cannot release an unlocked lock")
252+
raise LockError(
253+
"Cannot release a lock that's not owned or is already unlocked.",
254+
lock_name=self.name,
255+
)
253256
self.local.token = None
254257
return self.do_release(expected_token)
255258

redis/lock.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,10 @@ def release(self) -> None:
251251
"""
252252
expected_token = self.local.token
253253
if expected_token is None:
254-
raise LockError("Cannot release an unlocked lock", lock_name=self.name)
254+
raise LockError(
255+
"Cannot release a lock that's not owned or is already unlocked.",
256+
lock_name=self.name,
257+
)
255258
self.local.token = None
256259
self.do_release(expected_token)
257260

0 commit comments

Comments
 (0)