Typing issues fixed.

This commit is contained in:
L. Kärkkäinen 2023-10-25 07:11:59 +01:00
parent 1afea39cb2
commit 6ea5c44566
3 changed files with 6 additions and 6 deletions

View File

@ -133,7 +133,7 @@ if use_trio: # pragma: no cover
return trio.Path(path).stat()
open_async = trio.open_file
CancelledErrors = (asyncio.CancelledError, trio.Cancelled)
CancelledErrors: tuple[type[BaseException], ...] = (asyncio.CancelledError, trio.Cancelled)
else:
if PYPY_IMPLEMENTATION:
pypy_os_module_patch()

View File

@ -1,7 +1,7 @@
from __future__ import annotations
from asyncio import BaseTransport
from typing import TYPE_CHECKING, AnyStr
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from sanic.http.constants import HTTP
@ -12,10 +12,10 @@ from typing import Protocol
class HTMLProtocol(Protocol):
def __html__(self) -> AnyStr:
def __html__(self) -> str:
...
def _repr_html_(self) -> AnyStr:
def _repr_html_(self) -> str:
...

View File

@ -51,8 +51,8 @@ class SanicProtocol(asyncio.Protocol):
self._can_write = asyncio.Event()
self._can_write.set()
self._unix = unix
self._time = 0.0 # type: float
self._task = None # type: Optional[asyncio.Task]
self._time = 0.0
self._task: asyncio.Task | None = None
self._data_received = asyncio.Event()
@property