assert statements are optimised out, these statement were useless.
This commit is contained in:
parent
5794b3cd92
commit
c7303b3e66
1 changed files with 4 additions and 4 deletions
|
@ -44,10 +44,10 @@ class ModuleManager(object):
|
||||||
break
|
break
|
||||||
import_name = "bitbot_%s" % name
|
import_name = "bitbot_%s" % name
|
||||||
module = imp.load_source(import_name, filename)
|
module = imp.load_source(import_name, filename)
|
||||||
assert hasattr(module, "Module"
|
if not hasattr(module, "Module"):
|
||||||
), "module '%s' doesn't have a Module class."
|
raise ImportError("module '%s' doesn't have a Module class.")
|
||||||
assert inspect.isclass(module.Module
|
if not inspect.isclass(module.Module):
|
||||||
), "module '%s' has a Module attribute but it is not a class."
|
raise ImportError("module '%s' has a Module attribute but it is not a class.")
|
||||||
module_object = module.Module(self.bot)
|
module_object = module.Module(self.bot)
|
||||||
if not hasattr(module_object, "_name"):
|
if not hasattr(module_object, "_name"):
|
||||||
module_object._name = name.title()
|
module_object._name = name.title()
|
||||||
|
|
Loading…
Reference in a new issue