mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-06 20:16:47 +00:00
🚨 Develop: 添加 ruff linter (#2114)
This commit is contained in:
@ -39,7 +39,8 @@ try:
|
||||
from quart import Websocket as QuartWebSocket
|
||||
except ModuleNotFoundError as e: # pragma: no cover
|
||||
raise ImportError(
|
||||
"Please install Quart by using `pip install nonebot2[quart]`"
|
||||
"Please install Quart first to use this driver. "
|
||||
"Install with pip: `pip install nonebot2[quart]`"
|
||||
) from e
|
||||
|
||||
_AsyncCallable = TypeVar("_AsyncCallable", bound=Callable[..., Coroutine])
|
||||
@ -188,9 +189,7 @@ class Driver(ReverseDriver):
|
||||
async def _handle_http(self, setup: HTTPServerSetup) -> Response:
|
||||
request: Request = _request
|
||||
|
||||
json = None
|
||||
if request.is_json:
|
||||
json = await request.get_json()
|
||||
json = await request.get_json() if request.is_json else None
|
||||
|
||||
data = await request.form
|
||||
files_dict = await request.files
|
||||
|
Reference in New Issue
Block a user