10000 Merge pull request #14410 from charris/remove-cython-fallback · numpy/numpy@3fea61f · GitHub
[go: up one dir, main page]

Skip to content

Commit 3fea61f

Browse files
authored
Merge pull request #14410 from charris/remove-cython-fallback
BLD: Only allow using Cython module when cythonizing.
2 parents f786041 + 393a3a4 commit 3fea61f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

tools/cythonize.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,10 @@ def process_pyx(fromfile, tofile):
6060
# try the cython in the installed python first (somewhat related to scipy/scipy#2397)
6161
from Cython.Compiler.Version import version as cython_version
6262
except ImportError:
63-
# if that fails, use the one on the path, which might be the wrong version
64-
try:
65-
# Try the one on the path as a last resort
66-
subprocess.check_call(
67-
['cython'] + flags + ["-o", tofile, fromfile])
68-
except OSError:
69-
raise OSError('Cython needs to be installed')
63+
# The `cython` command need not point to the version installed in the
64+
# Python running this script, so raise an error to avoid the chance of
65+
# using the wrong version of Cython.
66+
raise OSError('Cython needs to be installed in Python as a module')
7067
else:
7168
# check the version, and invoke through python
7269
from distutils.version import LooseVersion

0 commit comments

Comments
 (0)
0