summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/compilers/__init__.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/spack/spack/compilers/__init__.py b/lib/spack/spack/compilers/__init__.py
index 8fe7a17116..ea79f655b0 100644
--- a/lib/spack/spack/compilers/__init__.py
+++ b/lib/spack/spack/compilers/__init__.py
@@ -102,15 +102,18 @@ def get_compiler_config(scope=None):
# configured. Avoid updating automatically if there ARE site
# compilers configured but no user ones.
# if (isinstance(arch, basestring) or arch == my_arch) and arch not in config:
- if scope is None:
- # We know no compilers were configured in any scope.
- init_compiler_config()
- elif scope == 'user':
- # Check the site config and update the user config if
- # nothing is configured at the site level.
- site_config = spack.config.get_config('compilers', scope='site')
- if not site_config:
+ if not config:
+ if scope is None:
+ # We know no compilers were configured in any scope.
init_compiler_config()
+ config = spack.config.get_config('compilers', scope=scope)
+ elif scope == 'user':
+ # Check the site config and update the user config if
+ # nothing is configured at the site level.
+ site_config = spack.config.get_config('compilers', scope='site')
+ if not site_config:
+ init_compiler_config()
+ config = spack.config.get_config('compilers', scope=scope)
return config