diff options
Diffstat (limited to 'numpy/distutils/fcompiler/environment.py')
-rw-r--r-- | numpy/distutils/fcompiler/environment.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/numpy/distutils/fcompiler/environment.py b/numpy/distutils/fcompiler/environment.py index 6ad712a3c..4d02bbdbb 100644 --- a/numpy/distutils/fcompiler/environment.py +++ b/numpy/distutils/fcompiler/environment.py @@ -51,13 +51,13 @@ class EnvironmentConfig(object): def _get_var(self, name, conf_desc): hook, envvar, confvar, convert, append = conf_desc + if convert is None: convert = lambda x: x var = self._hook_handler(name, hook) if envvar is not None: envvar_contents = os.environ.get(envvar) if envvar_contents is not None: - if convert: - envvar_contents = convert(envvar_contents) - if var and append: # in case var is None? + envvar_contents = convert(envvar_contents) + if var and append: if os.environ.get('NPY_DISTUTILS_APPEND_FLAGS', '0') == '1': var.extend(envvar_contents) else: @@ -72,13 +72,12 @@ 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) + if confvar in self._conf: + source, confvar_contents = self._conf[convvar] + var = convert(confvar_contents) return var + def clone(self, hook_handler): ec = self.__class__(distutils_section=self._distutils_section, **self._conf_keys) |