Commit 08af2499 authored by Denis Bilenko's avatar Denis Bilenko

hub.py: add support for list argument in _import

parent f1fd813f
......@@ -177,6 +177,14 @@ def set_hub(hub):
def _import(path):
if isinstance(path, list):
error = ImportError('Cannot import from empty list: %r' % (path, ))
for item in path:
try:
return _import(item)
except ImportError, ex:
error = ex
raise error
if not isinstance(path, basestring):
return path
module, item = path.rsplit('.', 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment