mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-02-17 16:20:05 +08:00
🐛 修复子插件加载失败时没有从父插件中移除的问题 (#1559)
This commit is contained in:
parent
d737679ccd
commit
d4e1bb7bf3
@ -65,6 +65,8 @@ def _revert_plugin(plugin: "Plugin") -> None:
|
||||
if plugin.name not in _plugins:
|
||||
raise RuntimeError("Plugin not found!")
|
||||
del _plugins[plugin.name]
|
||||
if parent_plugin := plugin.parent_plugin:
|
||||
parent_plugin.sub_plugins.remove(plugin)
|
||||
|
||||
|
||||
def get_plugin(name: str) -> Optional["Plugin"]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user