Skip to content

Commit

Permalink
修复py3.12运行迁移脚本错误 (#36)
Browse files Browse the repository at this point in the history
* 修复py3.12运行迁移脚本错误

* 版本号1.2.1b4
  • Loading branch information
ssttkkl authored Sep 15, 2024
1 parent a17581f commit b8177b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nonebot-plugin-access-control"
version = "1.2.1b3"
version = "1.2.1b4"
description = ""
authors = ["ssttkkl <[email protected]>"]
license = "MIT"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from sqlalchemy import inspect
from alembic.op import run_async
from nonebot import logger, require
from pkg_resources import DistributionNotFound, get_distribution
from sqlalchemy.ext.asyncio import AsyncSession, AsyncConnection

revision: str = "96ced46e72e9"
Expand Down Expand Up @@ -139,8 +138,13 @@ def upgrade(name: str = "") -> None:
if name:
return
try:
get_distribution("nonebot_plugin_datastore")
except DistributionNotFound:
from pkg_resources import DistributionNotFound, get_distribution

try:
get_distribution("nonebot_plugin_datastore")
except DistributionNotFound:
return
except ImportError:
return

logger.info("正在从 datastore 迁移数据……")
Expand Down

0 comments on commit b8177b1

Please sign in to comment.