fix type error

This commit is contained in:
xenia 2021-05-12 16:33:23 -04:00
parent ee8ec92c67
commit 9b42c8030c
1 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,6 @@ import errno
import re import re
import sys import sys
import termios import termios
import traceback
import tty import tty
from types import TracebackType from types import TracebackType
from typing import Any, List, Optional, Tuple, Type 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) pout.write(c)
await pout.drain() await pout.drain()
stdin_to_serial = asyncio.create_task(connect_pipe(stdin, serialout, True)) stdin_to_serial: asyncio.Task = asyncio.create_task(connect_pipe(stdin, serialout, True))
serial_to_stdout = asyncio.create_task(connect_pipe(serialin, stdout)) serial_to_stdout: asyncio.Task = asyncio.create_task(connect_pipe(serialin, stdout))
time_to_exit = asyncio.create_task(exit_flag.wait()) time_to_exit: asyncio.Task = asyncio.create_task(exit_flag.wait())
do_retry = False do_retry = False
@ -155,7 +154,8 @@ async def megacom(tty: str, baud: int, mode: str) -> None:
task.result() task.result()
return task.done() 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): if handle_done(time_to_exit):
pass pass
elif handle_done(stdin_to_serial): elif handle_done(stdin_to_serial):