From 58f1dc037afca48bbffed7589e87d34f52288857 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Thu, 7 Feb 2019 19:19:19 +0100 Subject: log-parse: fix error message when no error lines are found (#10543) --- lib/spack/spack/util/log_parse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/spack/spack/util/log_parse.py b/lib/spack/spack/util/log_parse.py index ae5992a992..467f9eb45f 100644 --- a/lib/spack/spack/util/log_parse.py +++ b/lib/spack/spack/util/log_parse.py @@ -76,7 +76,7 @@ def make_log_context(log_events, width=None): error_lines = set(e.line_no for e in log_events) log_events = sorted(log_events, key=lambda e: e.line_no) - num_width = len(str(max(error_lines))) + 4 + num_width = len(str(max(error_lines or [0]))) + 4 line_fmt = '%%-%dd%%s' % num_width indent = ' ' * (5 + num_width) -- cgit v1.2.3-60-g2f50