Skip to content

Commit 58a4b41

Browse files
authored
pyserial: Update type yielded by grep from tuple to ListPortInfo (#14807)
1 parent 8845352 commit 58a4b41

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

stubs/pyserial/serial/rfc2217.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,5 +183,5 @@ class PortManager:
183183
def telnet_send_option(self, action: bytes, option: bytes) -> None: ...
184184
def rfc2217_send_subnegotiation(self, option: bytes, value: bytes = b"") -> None: ...
185185
def check_modem_lines(self, force_notification: bool = False) -> None: ...
186-
def escape(self, data: bytes) -> Generator[bytes, None, None]: ...
187-
def filter(self, data: bytes) -> Generator[bytes, None, None]: ...
186+
def escape(self, data: bytes) -> Generator[bytes]: ...
187+
def filter(self, data: bytes) -> Generator[bytes]: ...

stubs/pyserial/serial/serialutil.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,4 @@ class SerialBase(io.RawIOBase):
149149
def send_break(self, duration: float = 0.25) -> None: ...
150150
def read_all(self) -> bytes | None: ...
151151
def read_until(self, expected: bytes = b"\n", size: int | None = None) -> bytes: ...
152-
def iread_until(self, expected: bytes = ..., size: int | None = ...) -> Generator[bytes, None, None]: ...
152+
def iread_until(self, expected: bytes = ..., size: int | None = ...) -> Generator[bytes]: ...

stubs/pyserial/serial/tools/list_ports.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import re
22
import sys
33
from collections.abc import Generator
44

5+
from serial.tools.list_ports_common import ListPortInfo
6+
57
if sys.platform == "win32":
68
from serial.tools.list_ports_windows import comports as comports
79
else:
810
from serial.tools.list_ports_posix import comports as comports
911

10-
def grep(regexp: str | re.Pattern[str], include_links: bool = False) -> Generator[tuple[str, str, str], None, None]: ...
12+
def grep(regexp: str | re.Pattern[str], include_links: bool = False) -> Generator[ListPortInfo]: ...
1113
def main() -> None: ...

stubs/pyserial/serial/tools/list_ports_windows.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ if sys.platform == "win32":
7474
depth: int = 0,
7575
last_serial_number: str | None = None,
7676
) -> str: ...
77-
def iterate_comports() -> Generator[ListPortInfo, None, None]: ...
77+
def iterate_comports() -> Generator[ListPortInfo]: ...
7878
def comports(include_links: bool = False) -> list[ListPortInfo]: ...

stubs/pyserial/serial/urlhandler/protocol_spy.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ from typing import TextIO, type_check_only
33

44
import serial
55

6-
def sixteen(data: bytes) -> Generator[tuple[str, str] | tuple[None, None], None, None]: ...
7-
def hexdump(data: bytes) -> Generator[tuple[int, str], None, None]: ...
6+
def sixteen(data: bytes) -> Generator[tuple[str, str] | tuple[None, None]]: ...
7+
def hexdump(data: bytes) -> Generator[tuple[int, str]]: ...
88
@type_check_only
99
class _Formatter:
1010
def rx(self, data: bytes) -> None: ...

0 commit comments

Comments
 (0)