mirror of
https://github.com/google/bumble.git
synced 2026-05-08 03:58:01 +00:00
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
|
return future
|
||||||
|
|
||||||
def on_event(*_):
|
def on_event(*_):
|
||||||
|
if future.done():
|
||||||
|
return
|
||||||
msg = f'abort: {event} event occurred.'
|
msg = f'abort: {event} event occurred.'
|
||||||
if isinstance(future, asyncio.Task):
|
if isinstance(future, asyncio.Task):
|
||||||
# python < 3.9 does not support passing a message on `Task.cancel`
|
# python < 3.9 does not support passing a message on `Task.cancel`
|
||||||
|
|||||||
Reference in New Issue
Block a user