1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-06-26 16:45:52 +00:00

chore: pyupgrade --py38-plus

This commit is contained in:
Mathieu Dupuy 2024-08-06 13:23:44 +02:00
parent 45f0b8809b
commit 34b449f27f
No known key found for this signature in database
GPG key ID: 08C1D4F32506B23A
4 changed files with 14 additions and 25 deletions

View file

@ -15,9 +15,9 @@
# along with Radicale. If not, see <http://www.gnu.org/licenses/>.
import contextlib
import sys
from typing import (Any, Callable, ContextManager, Iterator, List, Mapping,
MutableMapping, Sequence, Tuple, TypeVar, Union)
MutableMapping, Protocol, Sequence, Tuple, TypeVar, Union,
runtime_checkable)
WSGIResponseHeaders = Union[Mapping[str, str], Sequence[Tuple[str, str]]]
WSGIResponse = Tuple[int, WSGIResponseHeaders, Union[None, str, bytes]]
@ -41,20 +41,17 @@ def contextmanager(func: Callable[..., Iterator[_T]]
return result
if sys.version_info >= (3, 8):
from typing import Protocol, runtime_checkable
@runtime_checkable
class InputStream(Protocol):
def read(self, size: int = ...) -> bytes: ...
@runtime_checkable
class InputStream(Protocol):
def read(self, size: int = ...) -> bytes: ...
@runtime_checkable
class ErrorStream(Protocol):
def flush(self) -> object: ...
def write(self, s: str) -> object: ...
else:
ErrorStream = Any
InputStream = Any
@runtime_checkable
class ErrorStream(Protocol):
def flush(self) -> object: ...
def write(self, s: str) -> object: ...
from radicale import item, storage # noqa:E402 isort:skip