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.
This commit is contained in:
Todd Gamblin 2017-08-25 04:07:42 -07:00 committed by GitHub
parent a0f39397c1
commit 313771c734

View File

@ -739,7 +739,12 @@ def long_message(self):
# the build log with errors highlighted. # the build log with errors highlighted.
if self.build_log: if self.build_log:
events = parse_log_events(self.build_log) events = parse_log_events(self.build_log)
out.write("\n%d errors in build log:\n" % len(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)) out.write(make_log_context(events))
else: else: