From a0483d1d5c9b00a5cd1d6c5aa78f1b3ab99e882d Mon Sep 17 00:00:00 2001 From: passthem Date: Sun, 12 Oct 2025 11:52:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=AD=E8=A8=80=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/test_plugin_load.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/test_plugin_load.py b/scripts/test_plugin_load.py index a5bd7db..810aa8e 100644 --- a/scripts/test_plugin_load.py +++ b/scripts/test_plugin_load.py @@ -8,9 +8,12 @@ nonebot.load_plugins("konabot/plugins") plugins = nonebot.get_loaded_plugins() len_requires = len( - [f for f in ( - Path(__file__).parent.parent / "konabot" / "plugins" - ).iterdir() if f.is_dir() and (f / "__init__.py").exists()] + [ + f + for f in (Path(__file__).parent.parent / "konabot" / "plugins").iterdir() + if (f.is_dir() and (f / "__init__.py").exists()) + or ((not f.is_dir()) and f.suffix == ".py") + ] ) plugins = [p for p in plugins if p.module.__name__.startswith("konabot.plugins")]