summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorNathaniel J. Smith <njs@pobox.com>2017-05-08 22:19:51 -0700
committerNathaniel J. Smith <njs@pobox.com>2017-05-08 22:19:51 -0700
commit2ff70d0a462f994da84be20b41c0aa00e08594da (patch)
tree2689b9b2864bb36c3ba3fcc4e678cf050db393b9 /numpy
parent11f3ebf86a16452d0af40b41925b201485ae7f9c (diff)
downloadnumpy-2ff70d0a462f994da84be20b41c0aa00e08594da.tar.gz
BUG: if importing multiarray fails, don't discard the error message
This will hopefully make it easier to debug problems like those seen in gh-8653.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/core/__init__.py b/numpy/core/__init__.py
index ca2f45ece..b3a6967e1 100644
--- a/numpy/core/__init__.py
+++ b/numpy/core/__init__.py
@@ -14,13 +14,15 @@ for envkey in ['OPENBLAS_MAIN_FREE', 'GOTOBLAS_MAIN_FREE']:
try:
from . import multiarray
-except ImportError:
+except ImportError as exc:
msg = """
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
-"""
+
+Original error was: %s
+""" % (exc,)
raise ImportError(msg)
for envkey in env_added: