ruff: Fix UP007 Use X | Y for type annotations.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-07-11 17:30:23 -07:00
committed by Tim Abbott
parent e08a24e47f
commit 531b34cb4c
355 changed files with 2759 additions and 3029 deletions

View File

@@ -5,7 +5,7 @@ import sys
from contextlib import contextmanager
from io import SEEK_SET, TextIOWrapper
from types import TracebackType
from typing import IO, TYPE_CHECKING, Iterable, Iterator, Optional
from typing import IO, TYPE_CHECKING, Iterable, Iterator
from typing_extensions import override
@@ -111,7 +111,7 @@ class WrappedIO(IO[bytes]):
return self.stream.tell()
@override
def truncate(self, size: Optional[int] = None) -> int:
def truncate(self, size: int | None = None) -> int:
return self.truncate(size)
@override
@@ -147,9 +147,9 @@ class WrappedIO(IO[bytes]):
@override
def __exit__(
self,
exc_type: Optional[type[BaseException]],
exc_value: Optional[BaseException],
traceback: Optional[TracebackType],
exc_type: type[BaseException] | None,
exc_value: BaseException | None,
traceback: TracebackType | None,
) -> None:
self.stream.__exit__(exc_type, exc_value, traceback)