mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-22 01:46:15 +01:00
color_gcc: Check that cmd has elements in it before processing it.
This commit is contained in:
parent
9a60e7ed9e
commit
45bc50e523
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user