forked from auracaster/bumble_mirror
Merge pull request #122 from google/uael/abort-on-fix-invalid-state
utils: fix possible invalide state error while canceling future for `abort_on`
This commit is contained in:
@@ -78,6 +78,8 @@ class AbortableEventEmitter(EventEmitter):
|
||||
return future
|
||||
|
||||
def on_event(*_):
|
||||
if future.done():
|
||||
return
|
||||
msg = f'abort: {event} event occurred.'
|
||||
if isinstance(future, asyncio.Task):
|
||||
# python < 3.9 does not support passing a message on `Task.cancel`
|
||||
|
||||
Reference in New Issue
Block a user