diff options
author | Jeffrey Salmond <js947@users.noreply.github.com> | 2016-11-05 06:20:49 +0000 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2016-11-04 23:20:49 -0700 |
commit | a260e7e860aab97ec8e2ece1b6586504857ff27b (patch) | |
tree | 44859490189a053251962e6b7f82db7fff4ef2e6 | |
parent | 6d1c32d46a8fb66e83753cb31d3e2176f20c59fb (diff) | |
download | spack-a260e7e860aab97ec8e2ece1b6586504857ff27b.tar.gz spack-a260e7e860aab97ec8e2ece1b6586504857ff27b.tar.bz2 spack-a260e7e860aab97ec8e2ece1b6586504857ff27b.tar.xz spack-a260e7e860aab97ec8e2ece1b6586504857ff27b.zip |
Bugfix in concretize_compiler (#2196)
* fix bug in search for concrete compiler
* simplify implementation of concretize_compiler
* fix flake8 errors
-rw-r--r-- | lib/spack/spack/concretize.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py index 2351e2bfc9..2d5b66487e 100644 --- a/lib/spack/spack/concretize.py +++ b/lib/spack/spack/concretize.py @@ -385,14 +385,13 @@ class DefaultConcretizer(object): arch.platform_os) # copy concrete version into other_compiler - index = 0 - while not _proper_compiler_style(matches[index], spec.architecture): - index += 1 - if index == len(matches) - 1: - arch = spec.architecture - raise UnavailableCompilerVersionError(spec.compiler, - arch.platform_os) - spec.compiler = matches[index].copy() + try: + spec.compiler = next( + c for c in matches + if _proper_compiler_style(c, spec.architecture)).copy() + except StopIteration: + raise UnavailableCompilerVersionError(spec.compiler, + arch.platform_os) assert(spec.compiler.concrete) return True # things changed. |