clean up tasks
This commit is contained in:
parent
bd0f41afce
commit
5bbd7372d1
|
@ -203,8 +203,11 @@ async def megacom_main(stdin: asyncio.StreamReader, stdout: asyncio.StreamWriter
|
||||||
elif handle_done(serial_to_stdout):
|
elif handle_done(serial_to_stdout):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
time_to_exit.cancel()
|
||||||
stdin_to_serial.cancel()
|
stdin_to_serial.cancel()
|
||||||
serial_to_stdout.cancel()
|
serial_to_stdout.cancel()
|
||||||
|
with contextlib.suppress(asyncio.CancelledError):
|
||||||
|
await time_to_exit
|
||||||
with contextlib.suppress(asyncio.CancelledError):
|
with contextlib.suppress(asyncio.CancelledError):
|
||||||
with contextlib.suppress(serial.SerialException):
|
with contextlib.suppress(serial.SerialException):
|
||||||
await stdin_to_serial
|
await stdin_to_serial
|
||||||
|
|
Loading…
Reference in New Issue