mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-06 20:16:47 +00:00
🐛 fix import error for extra dependencies
This commit is contained in:
@ -5,15 +5,19 @@ AIOHTTP 驱动适配
|
||||
本驱动仅支持客户端连接
|
||||
"""
|
||||
|
||||
|
||||
import aiohttp
|
||||
|
||||
from nonebot.typing import overrides
|
||||
from nonebot.drivers import Request, Response
|
||||
from nonebot.drivers._block_driver import BlockDriver
|
||||
from nonebot.drivers import WebSocket as BaseWebSocket
|
||||
from nonebot.drivers import HTTPVersion, ForwardMixin, combine_driver
|
||||
|
||||
try:
|
||||
import aiohttp
|
||||
except ImportError:
|
||||
raise ImportError(
|
||||
"Please install aiohttp first to use this driver. `pip install nonebot2[aiohttp]`"
|
||||
) from None
|
||||
|
||||
|
||||
class AiohttpMixin(ForwardMixin):
|
||||
@property
|
||||
|
Reference in New Issue
Block a user