From 313771c73492882044ee47678d74193e895a9290 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Fri, 25 Aug 2017 04:07:42 -0700 Subject: 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. --- lib/spack/spack/build_environment.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3-60-g2f50