From a9f305a1c609aa3c12376e37717266a6dd62a35b Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Fri, 22 Nov 2024 23:37:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=AF=B9pydantic=20v?= =?UTF-8?q?1=E7=9A=84=E5=85=BC=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.py b/main.py index 9254f3f5..31441cfe 100644 --- a/main.py +++ b/main.py @@ -36,6 +36,12 @@ async def main_entry(loop: asyncio.AbstractEventLoop): print("已自动安装缺失的依赖包,请重启程序。") sys.exit(0) + # 检查pydantic版本,如果没有 pydantic.v1,则把 pydantic 映射为 v1 + import pydantic.version + if pydantic.version.VERSION < '2.0': + import pydantic + sys.modules['pydantic.v1'] = pydantic + # 检查配置文件 from pkg.core.bootutils import files