summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-09-18 13:51:22 +0300
committerGitHub <noreply@github.com>2020-09-18 13:51:22 +0300
commit385575faba79b5c857112199206119bf9ac2277f (patch)
tree121e4f780edcbadad26baa64330f48dc1cbfe921
parentc6853c7c27bb8352ab498848439d4fee9eb79a33 (diff)
parent6d3a9d7f97c1033de02a3a611ee3e8111f81738c (diff)
downloadnumpy-385575faba79b5c857112199206119bf9ac2277f.tar.gz
Merge pull request #17346 from BvB93/build-fix
BLD,BUG: Fix a macOS build failure when `NPY_BLAS_ORDER=""`
-rw-r--r--numpy/distutils/system_info.py6
-rw-r--r--numpy/distutils/tests/test_system_info.py8
2 files changed, 13 insertions, 1 deletions
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
index b4513825d..c3bd6347c 100644
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -471,6 +471,9 @@ def _parse_env_order(base_order, env):
allow_order = base_order.copy()
for order in orders:
+ if not order:
+ continue
+
if order not in base_order:
unknown_order.append(order)
continue
@@ -482,6 +485,9 @@ def _parse_env_order(base_order, env):
allow_order = []
for order in orders:
+ if not order:
+ continue
+
if order not in base_order:
unknown_order.append(order)
continue
diff --git a/numpy/distutils/tests/test_system_info.py b/numpy/distutils/tests/test_system_info.py
index 46ad9b103..ec15126f7 100644
--- a/numpy/distutils/tests/test_system_info.py
+++ b/numpy/distutils/tests/test_system_info.py
@@ -284,7 +284,7 @@ class TestSystemInfoReading:
assert info.get_lib_dirs() == lib_dirs
finally:
os.chdir(previousDir)
-
+
def test_distutils_parse_env_order(monkeypatch):
from numpy.distutils.system_info import _parse_env_order
@@ -298,6 +298,12 @@ def test_distutils_parse_env_order(monkeypatch):
assert order == list('bef')
assert len(unknown) == 1
+ # For when LAPACK/BLAS optimization is disabled
+ monkeypatch.setenv(env, '')
+ order, unknown = _parse_env_order(base_order, env)
+ assert len(order) == 0
+ assert len(unknown) == 0
+
for prefix in '^!':
monkeypatch.setenv(env, f'{prefix}b,i,e')
order, unknown = _parse_env_order(base_order, env)