From acb105ae6e64eb5c4bff9d07c94b0d831344e492 Mon Sep 17 00:00:00 2001 From: ProgramRipper Date: Sat, 17 Feb 2024 01:26:11 +0000 Subject: [PATCH] :bug: fix(alembic): incorrect change in 19aab8b7ce1c7383b5d4dd2cc52dbaa7be588187 fix #12 --- nonebot_plugin_orm/templates/multidb/env.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nonebot_plugin_orm/templates/multidb/env.py b/nonebot_plugin_orm/templates/multidb/env.py index 43529b4..deb242e 100644 --- a/nonebot_plugin_orm/templates/multidb/env.py +++ b/nonebot_plugin_orm/templates/multidb/env.py @@ -2,7 +2,6 @@ import asyncio from typing import cast -from contextlib import suppress from alembic import context from sqlalchemy.util import await_only @@ -127,7 +126,7 @@ async def run_migrations_online() -> None: else: coro = run_migrations_online() - with suppress(RuntimeError): + try: asyncio.run(coro) - - await_only(coro) + except RuntimeError: + await_only(coro)