fix type error
This commit is contained in:
parent
ee8ec92c67
commit
9b42c8030c
|
@ -5,7 +5,6 @@ import errno
|
|||
import re
|
||||
import sys
|
||||
import termios
|
||||
import traceback
|
||||
import tty
|
||||
from types import TracebackType
|
||||
from typing import Any, List, Optional, Tuple, Type
|
||||
|
@ -137,9 +136,9 @@ async def megacom(tty: str, baud: int, mode: str) -> None:
|
|||
pout.write(c)
|
||||
await pout.drain()
|
||||
|
||||
stdin_to_serial = asyncio.create_task(connect_pipe(stdin, serialout, True))
|
||||
serial_to_stdout = asyncio.create_task(connect_pipe(serialin, stdout))
|
||||
time_to_exit = asyncio.create_task(exit_flag.wait())
|
||||
stdin_to_serial: asyncio.Task = asyncio.create_task(connect_pipe(stdin, serialout, True))
|
||||
serial_to_stdout: asyncio.Task = asyncio.create_task(connect_pipe(serialin, stdout))
|
||||
time_to_exit: asyncio.Task = asyncio.create_task(exit_flag.wait())
|
||||
|
||||
do_retry = False
|
||||
|
||||
|
@ -155,7 +154,8 @@ async def megacom(tty: str, baud: int, mode: str) -> None:
|
|||
task.result()
|
||||
return task.done()
|
||||
|
||||
await asyncio.wait([time_to_exit, stdin_to_serial, serial_to_stdout], return_when=asyncio.FIRST_COMPLETED)
|
||||
await asyncio.wait([time_to_exit, stdin_to_serial, serial_to_stdout],
|
||||
return_when=asyncio.FIRST_COMPLETED)
|
||||
if handle_done(time_to_exit):
|
||||
pass
|
||||
elif handle_done(stdin_to_serial):
|
||||
|
|
Loading…
Reference in New Issue