From 2f60c5e9b4f346f77f8cbf33b95a207f8750097a Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Sat, 20 Jul 2024 14:03:32 +0800 Subject: [PATCH] =?UTF-8?q?:rotating=5Flight:=20Fix:=20=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E7=B1=BB=E5=9E=8B=E6=A0=87=E6=B3=A8=E5=92=8C=20annota?= =?UTF-8?q?ted=20=E5=A4=84=E7=90=86=20(#2828)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot/internal/driver/combine.py | 2 +- nonebot/typing.py | 5 +---- yarn.lock | 16 ++++++++++++---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/nonebot/internal/driver/combine.py b/nonebot/internal/driver/combine.py index c05e89b9..764b0818 100644 --- a/nonebot/internal/driver/combine.py +++ b/nonebot/internal/driver/combine.py @@ -15,7 +15,7 @@ def combine_driver(driver: type[D]) -> type[D]: ... @overload def combine_driver( - driver: type[D], _m: type[Mixin], *mixins: type[Mixin] + driver: type[D], __m: type[Mixin], /, *mixins: type[Mixin] ) -> type["CombinedDriver"]: ... diff --git a/nonebot/typing.py b/nonebot/typing.py index b282be1f..60d762ef 100644 --- a/nonebot/typing.py +++ b/nonebot/typing.py @@ -13,7 +13,6 @@ FrontMatter: import sys import types import warnings -import contextlib import typing as t import typing_extensions as t_ext from typing import TYPE_CHECKING, TypeVar @@ -86,9 +85,7 @@ def all_literal_values(type_: type[t.Any]) -> list[t.Any]: def origin_is_annotated(origin: t.Optional[type[t.Any]]) -> bool: """判断是否是 Annotated 类型""" - with contextlib.suppress(TypeError): - return origin is not None and issubclass(origin, t_ext.Annotated) - return False + return origin is t_ext.Annotated NONE_TYPES = {None, type(None), t.Literal[None], t_ext.Literal[None]} diff --git a/yarn.lock b/yarn.lock index 5fbc8b29..50868ce9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1512,7 +1512,7 @@ sitemap "^7.1.1" tslib "^2.4.0" -"@docusaurus/react-loadable@5.5.2", "react-loadable@npm:@docusaurus/react-loadable@5.5.2": +"@docusaurus/react-loadable@5.5.2": version "5.5.2" resolved "https://registry.npmjs.org/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz#81aae0db81ecafbdaee3651f12804580868fa6ce" integrity sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ== @@ -7620,9 +7620,9 @@ pure-color@^1.2.0: integrity sha512-QFADYnsVoBMw1srW7OVKEYjG+MbIa49s54w1MA1EDY6r2r/sTcKKYqRX1f4GYvnXP7eN/Pe9HFcX+hwzmrXRHA== pyright@^1.1.317: - version "1.1.352" - resolved "https://registry.npmjs.org/pyright/-/pyright-1.1.352.tgz#2feb37438bc79ddf2bc1fdcc139f4ba088719f14" - integrity sha512-X7fuuB24n3RIVCEPovrAadYJjxeB5RccArug+/oLwQnsHbSaDUQVHHkF/PJHkKpaIPX/RboG+EW8uCNUp1RnwQ== + version "1.1.372" + resolved "https://registry.npmjs.org/pyright/-/pyright-1.1.372.tgz#4ac7b6ca189b58629ef26445f98c6685849dda5a" + integrity sha512-S0XYmTQWK+ha9FTIWviNk91UnbD569wPUCNEltSqtHeTJhbHj5z3LkOKiqXAOvn72BBfylcgpQqyQHsocmQtiQ== optionalDependencies: fsevents "~2.3.3" @@ -7805,6 +7805,14 @@ react-loadable-ssr-addon-v5-slorber@^1.0.1: dependencies: "@babel/runtime" "^7.10.3" +"react-loadable@npm:@docusaurus/react-loadable@5.5.2": + version "5.5.2" + resolved "https://registry.npmjs.org/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz#81aae0db81ecafbdaee3651f12804580868fa6ce" + integrity sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ== + dependencies: + "@types/react" "*" + prop-types "^15.6.2" + react-router-config@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/react-router-config/-/react-router-config-5.1.1.tgz#0f4263d1a80c6b2dc7b9c1902c9526478194a988"