diff options
| author | 2018-02-04 09:27:54 +0000 | |
|---|---|---|
| committer | 2018-02-04 09:27:54 +0000 | |
| commit | 840fbcdb10b49861f8d51869dc7b832a16fdf35b (patch) | |
| tree | d276f056da9e88a6a3d4fc517ac4475d6f993870 /ModuleManager.py | |
| parent | NR: Eagle endpoints are now under /json/ going forward (diff) | |
| parent | Fix crash on PRIVMSG with nothing but whitespace (diff) | |
| signature | ||
Merge branch 'master' of github.com:jesopo/bitbot
Diffstat (limited to 'ModuleManager.py')
| -rw-r--r-- | ModuleManager.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ModuleManager.py b/ModuleManager.py index fdc2108d..2354a799 100644 --- a/ModuleManager.py +++ b/ModuleManager.py @@ -44,10 +44,10 @@ class ModuleManager(object): break import_name = "bitbot_%s" % name module = imp.load_source(import_name, filename) - assert hasattr(module, "Module" - ), "module '%s' doesn't have a Module class." - assert inspect.isclass(module.Module - ), "module '%s' has a Module attribute but it is not a class." + if not hasattr(module, "Module"): + raise ImportError("module '%s' doesn't have a Module class.") + if not inspect.isclass(module.Module): + raise ImportError("module '%s' has a Module attribute but it is not a class.") module_object = module.Module(self.bot) if not hasattr(module_object, "_name"): module_object._name = name.title() |
