修复插件中使用相对导入时会爆炸
This commit is contained in:
@@ -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}")
|
||||||
|
|||||||
Reference in New Issue
Block a user