`get_lock` should raise a TimeoutError if `lock.acquire` is False

This commit is contained in:
Fabio Manganiello 2023-03-31 22:31:32 +02:00
parent 9693becb9e
commit 42d468c895
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
1 changed files with 2 additions and 0 deletions

View File

@ -579,6 +579,8 @@ def get_lock(
result = lock.acquire(**kwargs)
try:
if not result:
raise TimeoutError()
yield result
finally:
if result: