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

This commit is contained in:
UnCLAS-Prommer
2025-07-28 09:46:40 +08:00
parent d8191c493a
commit 0c302c9ca5

View File

@@ -289,6 +289,7 @@ class PluginManager:
return False return False
module = module_from_spec(spec) module = module_from_spec(spec)
module.__package__ = module_name # 设置模块包名
spec.loader.exec_module(module) spec.loader.exec_module(module)
logger.debug(f"插件模块加载成功: {plugin_file}") logger.debug(f"插件模块加载成功: {plugin_file}")