mirror of
https://github.com/nonebot/nonebot2.git
synced 2026-07-29 03:33:41 +00:00
📝 replace deprecated caution/important admonitions
This commit is contained in:
@@ -558,7 +558,7 @@ async def _(x: httpx.AsyncClient = Depends(get_client)):
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
:::caution 注意
|
||||
:::warning 注意
|
||||
生成器作为依赖时,其中只能进行一次 `yield`,否则将会触发异常。如果对此有疑问并想探究原因,可以参考 [contextmanager](https://docs.python.org/zh-cn/3/library/contextlib.html#contextlib.contextmanager) 和 [asynccontextmanager](https://docs.python.org/zh-cn/3/library/contextlib.html#contextlib.asynccontextmanager) 文档。事实上,NoneBot 内部就使用了这两个装饰器。
|
||||
:::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user