修复插件中使用相对导入时会爆炸

This commit is contained in:
UnCLAS-Prommer committed 2025-07-28 09:47:53 +08:00
1 parent 6899adee05
commit 39891eef6d
1 file changed
+1
+1
View File
@@ -289,6 +289,7 @@ class PluginManager:
return False
module = module_from_spec(spec)
module.__package__ = module_name # 设置模块包名
spec.loader.exec_module(module)
logger.debug(f"插件模块加载成功: {plugin_file}")