Skip to content

Commit 7a415c9

Browse files
committed
cast instead of ignore typing
1 parent 1620dbe commit 7a415c9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎chess/engine.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ def __init__(self) -> None:
977977

978978
def connection_made(self, transport: asyncio.BaseTransport) -> None:
979979
# SubprocessTransport expected, but not checked to allow duck typing.
980-
self.transport = transport # type: ignore
980+
self.transport = typing.cast(asyncio.SubprocessTransport, transport)
981981
LOGGER.debug("%s: Connection made", self)
982982

983983
def connection_lost(self, exc: Exception | None) -> None:
@@ -1007,7 +1007,7 @@ def send_line(self, line: str) -> None:
10071007
stdin.write((line + "\n").encode("utf-8")) # type: ignore
10081008

10091009
def pipe_data_received(self, fd: int, data: bytes | str) -> None:
1010-
self.buffer[fd].extend(data) # type: ignore
1010+
self.buffer[fd].extend(typing.cast(bytes, data))
10111011
while b"\n" in self.buffer[fd]:
10121012
line_bytes, self.buffer[fd] = self.buffer[fd].split(b"\n", 1)
10131013
if line_bytes.endswith(b"\r"):

0 commit comments

Comments
 (0)