requirements: Upgrade Python requirements.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2023-04-25 17:52:20 -07:00
committed by Anders Kaseorg
parent f74cfe0ed5
commit 03b3c8522d
12 changed files with 1131 additions and 427 deletions

View File

@@ -5,7 +5,10 @@ import sys
from contextlib import contextmanager
from io import SEEK_SET, TextIOWrapper
from types import TracebackType
from typing import IO, Iterable, Iterator, List, Optional, Type
from typing import IO, TYPE_CHECKING, Iterable, Iterator, List, Optional, Type
if TYPE_CHECKING:
from _typeshed import ReadableBuffer
class ExtraConsoleOutputInTestError(Exception):
@@ -97,12 +100,12 @@ class WrappedIO(IO[bytes]):
def writable(self) -> bool:
return self.stream.writable()
def write(self, data: bytes) -> int:
def write(self, data: "ReadableBuffer") -> int:
num_chars = self.stream.write(data)
self.extra_output_finder.find_extra_output(data)
self.extra_output_finder.find_extra_output(bytes(data))
return num_chars
def writelines(self, data: Iterable[bytes]) -> None:
def writelines(self, data: "Iterable[ReadableBuffer]") -> None:
data, data_copy = itertools.tee(data)
self.stream.writelines(data)
lines = b"".join(data_copy)