Merge pull request #334 from nonebot/yanyongyu/issue332

Fix: log module name error
This commit is contained in:
Ju4tCode
2021-04-19 21:50:11 +08:00
committed by GitHub
2 changed files with 7 additions and 0 deletions

View File

@ -215,6 +215,9 @@ class PluginLoader(SourceFileLoader):
return
# really need?
# setattr(module, "__manager__", self.manager)
if self._plugin_token:
setattr(module, "__plugin_name__",
_current_plugin.get(self._plugin_token))
if self._export_token:
setattr(module, "__export__", _export.get())