[Scons-users] command-line call without error

Rob Deckers Rob.Deckers at vanderlande.com
Fri Dec 6 07:04:13 EST 2013

Hi all.
In my AStyle tool for SCons, I do a command line call to AStyle.
When AStyle failes, I would like to log a warning, NO error and not stop the build.
Currently, I have :
# create the style command
cmd = "${STYLEEXE} %s ${STYLEFLAGS} ${_STYLEEXCLUDEFLAGS}" % filestostyle

# Warn about the failure, but do not fail the build when Style fails.
if env.Execute(cmd):
SCons.Warnings.warn(ToolStyleWarning, "code styler tool: '%s' failed!" % (env['STYLEEXE']))
This almost works, I do not stop the build, log a warning, but ALSO an error when AStyle failes.
According to the SCons manual, this is behavior of env.Execute:
"Note that scons will print an error message if the executed action fails--that is, exits with or returns a non-zero value."
How do I NOT print an error when my command line call failes?
Best regards,

** Disclaimer **

This e-mail, including any attachments, may include proprietary and confidential information of Vanderlande Industries and may only be read by the person or those persons to whom it is addressed.
This document is forwarded to you in such a form (e-mail) that Vanderlande Industries cannot guarantee the completeness and/or correctness of its contents and information.
If you have received this e-mail message in error, please notify us immediately. Please also delete this document from your computer.
This document may not be reproduced, copied, distributed, published, modified, or furnished to third parties, without the prior written consent of Vanderlande Industries.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20131206/699269de/attachment.htm

More information about the Scons-users mailing list