Commit 344e53ea authored by Denis Bilenko's avatar Denis Bilenko

avoid printing traceback of overriden exception in py3k

parent 09280fdf
......@@ -190,9 +190,8 @@ def _import(path):
module, item = path.rsplit('.', 1)
x = __import__(module)
for attr in path.split('.')[1:]:
try:
x = getattr(x, attr)
except AttributeError:
x = getattr(x, attr, _NONE)
if x is _NONE:
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