1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2025-03-13 12:07:32 +00:00

🐛 Don't keep dispensers locked if a conversation raises

This commit is contained in:
Steffo 2021-04-03 18:35:33 +02:00
parent 812d16ab06
commit 0f07d5c2b2
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -95,10 +95,11 @@ class Dispenser:
log.debug(f"Adding lock: {conv!r}")
self._locked_by.append(conv)
yield
log.debug(f"Clearing lock: {conv!r}")
self._locked_by.remove(conv)
try:
yield
finally:
log.debug(f"Clearing lock: {conv!r}")
self._locked_by.remove(conv)
__all__ = (