Raise exception instead of assert...

This commit is contained in:
Valentin Lorentz 2020-03-21 02:20:59 +01:00
parent 487897e7cc
commit de77ce6ddc

View File

@ -73,7 +73,7 @@ def loadPluginModule(name, ignoreDeprecation=False):
# spec is None if 'name' can't be found; and # spec is None if 'name' can't be found; and
# spec.loader might be None in some rare occasions as well # spec.loader might be None in some rare occasions as well
# (eg. for namespace packages) # (eg. for namespace packages)
assert ImportError(name) raise ImportError(name)
module = importlib.util.module_from_spec(spec) module = importlib.util.module_from_spec(spec)
sys.modules[module.__name__] = module sys.modules[module.__name__] = module
spec.loader.exec_module(module) spec.loader.exec_module(module)