🐛 fix parent plugin detect error

This commit is contained in:
yanyongyu
2021-12-20 00:28:17 +08:00
parent c2c3d5ef4b
commit 44e5182322
2 changed files with 15 additions and 5 deletions

View File

@ -150,9 +150,11 @@ class PluginLoader(SourceFileLoader):
if self.loaded:
return
plugin = _new_plugin(self.name, module)
plugin = _new_plugin(self.name, module, self.manager)
parent_plugin = _current_plugin.get()
if parent_plugin:
if parent_plugin and _managers.index(parent_plugin.manager) < _managers.index(
self.manager
):
plugin.parent_plugin = parent_plugin
parent_plugin.sub_plugins.add(plugin)