Commit f1fd813f authored by Denis Bilenko's avatar Denis Bilenko

hub.py: make _import raise ImportError instead of AttributeError

parent 17f3c9f8
......@@ -182,7 +182,10 @@ def _import(path):
module, item = path.rsplit('.', 1)
x = __import__(module)
for attr in path.split('.')[1:]:
x = getattr(x, attr)
try:
x = getattr(x, attr)
except AttributeError:
raise ImportError('cannot import name %r from %r' % (attr, x))
return x
......
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