Skip to content

Commit ac347c7

Browse files
committed
Raise an exception so numpy gets installed
1 parent 507dac9 commit ac347c7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
# Bootstrap a numpy installation before trying to import it.
77
import importlib
88
try:
9-
importlib.util.find_spec('numpy')
10-
except ImportError:
9+
numpy_module = importlib.util.find_spec('numpy')
10+
if numpy_module is None:
11+
raise ModuleNotFoundError
12+
except (ImportError, ModuleNotFoundError):
1113
import subprocess
1214
subprocess.call([sys.executable, '-m', 'pip', 'install', 'numpy'])
1315

0 commit comments

Comments
 (0)