mirror of https://github.com/Mai-with-u/MaiBot.git
修复插件中使用相对导入时会爆炸
parent
6899adee05
commit
39891eef6d
|
|
@ -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}")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue