Another mypy update another round of spurious errors

This commit is contained in:
Kovid Goyal
2022-11-08 17:12:49 +05:30
parent 72f92b395f
commit 2e8ef66496
4 changed files with 9 additions and 9 deletions

View File

@@ -506,17 +506,17 @@ def parse_address_spec(spec: str) -> Tuple[AddressFamily, Union[Tuple[str, int],
def write_all(fd: int, data: Union[str, bytes], block_until_written: bool = True) -> None:
if isinstance(data, str):
data = data.encode('utf-8')
data = memoryview(data)
while data:
mvd = memoryview(data)
while len(mvd) > 0:
try:
n = os.write(fd, data)
n = os.write(fd, mvd)
except BlockingIOError:
if not block_until_written:
raise
continue
if not n:
break
data = data[n:]
mvd = mvd[n:]
class TTYIO: