ruff-only #1

Open
leo wants to merge 17 commits from ruff-only into main
3 changed files with 6 additions and 6 deletions
Showing only changes of commit 6ea5c44566 - Show all commits

View File

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

View File

@ -1,7 +1,7 @@
from __future__ import annotations from __future__ import annotations
from asyncio import BaseTransport from asyncio import BaseTransport
from typing import TYPE_CHECKING, AnyStr from typing import TYPE_CHECKING
if TYPE_CHECKING: if TYPE_CHECKING:
from sanic.http.constants import HTTP from sanic.http.constants import HTTP
@ -12,10 +12,10 @@ from typing import Protocol
class HTMLProtocol(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 = asyncio.Event()
self._can_write.set() self._can_write.set()
self._unix = unix self._unix = unix
self._time = 0.0 # type: float self._time = 0.0
self._task = None # type: Optional[asyncio.Task] self._task: asyncio.Task | None = None
self._data_received = asyncio.Event() self._data_received = asyncio.Event()
@property @property