From 8ba50b7bd6ef260707e0266fe42f4184540e086d Mon Sep 17 00:00:00 2001 From: snowy Date: Sun, 18 Aug 2024 04:34:54 +0800 Subject: [PATCH] =?UTF-8?q?:children=5Fcrossing:=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liteyuki/plugin/load.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/liteyuki/plugin/load.py b/liteyuki/plugin/load.py index 5b02bf7f..c4bbd32d 100644 --- a/liteyuki/plugin/load.py +++ b/liteyuki/plugin/load.py @@ -69,6 +69,9 @@ def load_plugins(*plugin_dir: str) -> set[Plugin]: plugins = set() for dir_path in plugin_dir: # 遍历每一个文件夹下的py文件和包含__init__.py的文件夹,不递归 + if not os.path.exists(dir_path): + logger.warning(f"Plugins dir '{dir_path}' does not exist.") + continue for f in os.listdir(dir_path): path = Path(os.path.join(dir_path, f))