mirror of https://gitlab.com/ita1024/waf.git
msvcdeps: fix 'WafError' AttributeError
This patch corrects an error in the exec_response_command exception handler which always assumed that the execution's stdout would be bound to the the WafError exception object. However, this assumption is only true when the execution completes with a non-zero status code. For other exceptions, the stdout attribute is not bound. Now, when stdout is not available, the WafError msg will be used instead.
This commit is contained in:
parent
5e90de89d8
commit
cce984f77b
|
@ -213,8 +213,12 @@ def exec_command(self, cmd, **kw):
|
|||
raw_out = self.generator.bld.cmd_and_log(cmd + ['@' + tmp], **kw)
|
||||
ret = 0
|
||||
except Errors.WafError as e:
|
||||
raw_out = e.stdout
|
||||
ret = e.returncode
|
||||
# Use e.msg if e.stdout is not set
|
||||
raw_out = getattr(e, 'stdout', e.msg)
|
||||
|
||||
# Return non-zero error code even if we didn't
|
||||
# get one from the exception object
|
||||
ret = getattr(e, 'returncode', 1)
|
||||
|
||||
for line in raw_out.splitlines():
|
||||
if line.startswith(INCLUDE_PATTERN):
|
||||
|
|
Loading…
Reference in New Issue