Commit 7e034d44 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

py3: also catch ImportError when relative import fails

Python 3 apparently raises an ImportError where Python 2 raised a
parent f30c1fab7155
......@@ -23,8 +23,9 @@
except ValueError as exc:
if str(exc) != 'Attempted relative import in non-package':
except (ValueError, ImportError) as exc:
if (isinstance(exc, ValueError)
and str(exc) != 'Attempted relative import in non-package'):
# extension imported using direct path
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
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