Skip to content

Commit 52eddca

Browse files
authored
🐛 fix annotated process
1 parent 52bf2f2 commit 52eddca

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

nb_cli/compat.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
为兼容 Pydantic V1 与 V2 版本,定义了一系列兼容函数与类供使用。
44
"""
55

6-
import contextlib
76
from dataclasses import dataclass, is_dataclass
87
from typing import Any, Union, TypeVar, Optional, Annotated
98
from typing_extensions import Self, get_args, get_origin, is_typeddict
@@ -34,9 +33,7 @@
3433

3534
def origin_is_annotated(origin: Optional[type[Any]]) -> bool:
3635
"""判断是否是 Annotated 类型"""
37-
with contextlib.suppress(TypeError):
38-
return origin is not None and issubclass(origin, Annotated)
39-
return False
36+
return origin is Annotated
4037

4138

4239
if PYDANTIC_V2: # pragma: pydantic-v2

0 commit comments

Comments
 (0)