diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2017-08-25 04:07:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-25 04:07:42 -0700 |
commit | 313771c73492882044ee47678d74193e895a9290 (patch) | |
tree | d36068c47920466c6246ed7ef447224e79d39254 /lib | |
parent | a0f39397c1efe1d94bbac6fb8a52f8a8113338cb (diff) | |
download | spack-313771c73492882044ee47678d74193e895a9290.tar.gz spack-313771c73492882044ee47678d74193e895a9290.tar.bz2 spack-313771c73492882044ee47678d74193e895a9290.tar.xz spack-313771c73492882044ee47678d74193e895a9290.zip |
Improve grammar in build log error message. (#5214)
- "1 error found" instead of "1 errors found"
- don't print any build log context if no errors were found; just refer
the user to the build log.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/build_environment.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index 896cbe879b..7bef1d3789 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -739,8 +739,13 @@ class ChildError(spack.error.SpackError): # the build log with errors highlighted. if self.build_log: events = parse_log_events(self.build_log) - out.write("\n%d errors in build log:\n" % len(events)) - out.write(make_log_context(events)) + nerr = len(events) + if nerr > 0: + if nerr == 1: + out.write("\n1 error found in build log:\n") + else: + out.write("\n%d errors found in build log:\n" % nerr) + out.write(make_log_context(events)) else: # The error happened in in the Python code, so try to show |