Remove unnecessary pkg name from import_class.

This commit is contained in:
David Shrewsbury
2012-09-21 15:09:30 -04:00
parent 4000dd7628
commit db6d3dc67a

View File

@@ -21,7 +21,7 @@ def import_class(import_str):
""" Returns a class from a string including module and class """
mod_str, _sep, class_str = import_str.rpartition('.')
try:
mod = importlib.import_module(mod_str, 'libra.worker.drivers')
mod = importlib.import_module(mod_str)
return getattr(mod, class_str)
except (ValueError, AttributeError):
raise ImportError('Class %s cannot be found (%s)' %