Merge branch 'contrib/github_pr_8419' into 'master'

Added typing to serial_write() (GitHub PR)

Closes IDFGH-6792

See merge request espressif/esp-idf!17193
This commit is contained in:
Roland Dobai 2022-02-17 19:46:06 +00:00
commit e18fb46bc0

View File

@ -178,7 +178,7 @@ class Monitor:
pass
normal_print('\n')
def serial_write(self, *args, **kwargs): # type: ignore
def serial_write(self, *args: str, **kwargs: str) -> None:
raise NotImplementedError
def check_gdb_stub_and_run(self, line: bytes) -> None:
@ -237,7 +237,7 @@ class SerialMonitor(Monitor):
self.gdb_helper.gdb_exit = False
self.serial_handler.start_cmd_sent = False
def serial_write(self, *args, **kwargs): # type: ignore
def serial_write(self, *args: str, **kwargs: str) -> None:
self.serial: serial.Serial
try:
self.serial.write(*args, **kwargs)
@ -268,7 +268,7 @@ class LinuxMonitor(Monitor):
self.console_reader.start()
self.serial_reader.start()
def serial_write(self, *args, **kwargs): # type: ignore
def serial_write(self, *args: str, **kwargs: str) -> None:
self.serial.stdin.write(*args, **kwargs)
def check_gdb_stub_and_run(self, line: bytes) -> None: