summaryrefslogtreecommitdiff
path: root/numpy/linalg/lapack_lite/make_lite.py
diff options
context:
space:
mode:
authorDimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>2021-09-21 15:14:10 +0200
committerDimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>2021-09-21 18:44:04 +0200
commit5cece38e4bd103e2dfbd2cb0c2e0b64256f5f485 (patch)
treed5eabb8c0299f3b1186f250f56303dd2b476b553 /numpy/linalg/lapack_lite/make_lite.py
parentf807a0bafcbdfcccb1525f051e9df11053ac4eac (diff)
downloadnumpy-5cece38e4bd103e2dfbd2cb0c2e0b64256f5f485.tar.gz
REV: 96727cf
This is a Python 2 script, and will remain so for some time. Instead of simply reverting the commit, use try/except to find the proper way to import which.
Diffstat (limited to 'numpy/linalg/lapack_lite/make_lite.py')
-rwxr-xr-xnumpy/linalg/lapack_lite/make_lite.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/linalg/lapack_lite/make_lite.py b/numpy/linalg/lapack_lite/make_lite.py
index 73e4d194e..398c27e94 100755
--- a/numpy/linalg/lapack_lite/make_lite.py
+++ b/numpy/linalg/lapack_lite/make_lite.py
@@ -21,7 +21,10 @@ import shutil
import fortran
import clapack_scrub
-from shutil import which
+try:
+ from distutils.spawn import find_executable as which # Python 2
+except ImportError:
+ from shutil import which # Python 3
# Arguments to pass to f2c. You'll always want -A for ANSI C prototypes
# Others of interest: -a to not make variables static by default