Skip to content

Commit

Permalink
🐛 修复子插件加载失败时没有从父插件中移除的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
A-kirami committed Jan 6, 2023
1 parent 1d5d160 commit d0b05d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nonebot/plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down

0 comments on commit d0b05d0

Please sign in to comment.