Collect `asyncio` task exceptions to avoid warning msg
parent
5f4094691d
commit
6803891bd7
|
@ -136,6 +136,13 @@ def _run_asyncio_task(
|
||||||
nonlocal aio_err
|
nonlocal aio_err
|
||||||
aio_err = from_aio._err
|
aio_err = from_aio._err
|
||||||
|
|
||||||
|
# only to avoid ``asyncio`` complaining about uncaptured
|
||||||
|
# task exceptions
|
||||||
|
try:
|
||||||
|
task.exception()
|
||||||
|
except BaseException as terr:
|
||||||
|
assert type(terr) is type(aio_err), 'Asyncio task error mismatch?'
|
||||||
|
|
||||||
if aio_err is not None:
|
if aio_err is not None:
|
||||||
if type(aio_err) is CancelledError:
|
if type(aio_err) is CancelledError:
|
||||||
log.cancel("infected task was cancelled")
|
log.cancel("infected task was cancelled")
|
||||||
|
|
Loading…
Reference in New Issue