No compiler found: fixed error message (#4034)

When a compiler was not found a stacktrace was displayed to user because
there were three arguments to be substituted in a string with only two
substitutions to be done.
This commit is contained in:
Massimiliano Culpo 2017-04-28 15:37:47 +02:00 committed by Adam J. Stewart
parent 8d92e26712
commit 59ac047996

View File

@ -451,10 +451,11 @@ class UnavailableCompilerVersionError(spack.error.SpackError):
compiler spec.""" compiler spec."""
def __init__(self, compiler_spec, arch=None): def __init__(self, compiler_spec, arch=None):
err_msg = "No compilers with spec %s found" % compiler_spec err_msg = "No compilers with spec {0} found".format(compiler_spec)
if arch: if arch:
err_msg += (" for operating system %s and target %s." % err_msg += " for operating system {0} and target {1}.".format(
(compiler_spec, arch.platform_os, arch.target)) arch.platform_os, arch.target
)
super(UnavailableCompilerVersionError, self).__init__( super(UnavailableCompilerVersionError, self).__init__(
err_msg, "Run 'spack compiler find' to add compilers.") err_msg, "Run 'spack compiler find' to add compilers.")