🐛 fix message construct typing and plugins loading

This commit is contained in:
yanyongyu
2020-12-31 14:00:59 +08:00
parent a98417a878
commit 938b5bf275
4 changed files with 35 additions and 16 deletions

View File

@ -897,7 +897,10 @@ def load_plugins(*plugin_dir: str) -> Set[Plugin]:
return None
spec = module_info.module_finder.find_spec(name, None)
if spec.name in plugins:
if not spec:
logger.warning(
f"Module {name} cannot be loaded! Check module name first.")
elif spec.name in plugins:
return None
elif spec.name in sys.modules:
logger.warning(