Skip to content

Commit

Permalink
feat: 添加对pydantic v1的兼容性
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Nov 22, 2024
1 parent e8cc048 commit a9f305a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a9f305a

Please sign in to comment.