From 45bc50e523de3a31a9a67826ddca5937ee8ec11f Mon Sep 17 00:00:00 2001 From: Erik Parker Date: Mon, 21 Jun 2021 13:45:26 -0500 Subject: [PATCH] color_gcc: Check that cmd has elements in it before processing it. --- waflib/extras/color_gcc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waflib/extras/color_gcc.py b/waflib/extras/color_gcc.py index b68c5ebf..09729035 100644 --- a/waflib/extras/color_gcc.py +++ b/waflib/extras/color_gcc.py @@ -19,7 +19,7 @@ class ColorGCCFormatter(Logs.formatter): func = frame.f_code.co_name if func == 'exec_command': cmd = frame.f_locals.get('cmd') - if isinstance(cmd, list) and ('gcc' in cmd[0] or 'g++' in cmd[0]): + if isinstance(cmd, list) and (len(cmd) > 0) and ('gcc' in cmd[0] or 'g++' in cmd[0]): lines = [] for line in rec.msg.splitlines(): if 'warning: ' in line: