summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Feng <rainwoodman@gmail.com>2019-03-02 12:46:58 -0800
committerGitHub <noreply@github.com>2019-03-02 12:46:58 -0800
commiteb85c3fda4a1a2687745d7ac5d0a96fc94691f77 (patch)
treec9b1002d98adac622115b71a02b17356bea52773
parente21d2cbdf15a86e16ef4877a42ed98d97ea296d3 (diff)
downloadnumpy-eb85c3fda4a1a2687745d7ac5d0a96fc94691f77.tar.gz
Convert fortran flags from environment variable
This PR fixes #13074.
-rw-r--r--numpy/distutils/fcompiler/environment.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/numpy/distutils/fcompiler/environment.py b/numpy/distutils/fcompiler/environment.py
index 4238f35cb..6ad712a3c 100644
--- a/numpy/distutils/fcompiler/environment.py
+++ b/numpy/distutils/fcompiler/environment.py
@@ -55,9 +55,11 @@ class EnvironmentConfig(object):
if envvar is not None:
envvar_contents = os.environ.get(envvar)
if envvar_contents is not None:
- if var and append:
+ if convert:
+ envvar_contents = convert(envvar_contents)
+ if var and append: # in case var is None?
if os.environ.get('NPY_DISTUTILS_APPEND_FLAGS', '0') == '1':
- var = var + [envvar_contents]
+ var.extend(envvar_contents)
else:
var = envvar_contents
if 'NPY_DISTUTILS_APPEND_FLAGS' not in os.environ.keys():
@@ -70,6 +72,8 @@ class EnvironmentConfig(object):
else:
var = envvar_contents
if confvar is not None and self._conf:
+ # FIXME: conf shall do the conversion immediately after the key is parsed.
+ # postpartum conversion will not always catch the right cases.
var = self._conf.get(confvar, (None, var))[1]
if convert is not None:
var = convert(var)