mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Anders Kaseorg
parent
f74cfe0ed5
commit
03b3c8522d
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user