scons - How to get the exit status in python -
i using scons build tool renesas compiler.
i want know exit status of scons when build terminated error.
when scons executed project return 0. how exit status or number check erros.
is there function in python them.
thanks
there scons.script.main.exit_status
, scons.script.main.exit_status.code
, i've found them unreliable in practice (i.e. differ actual return code).
the actual exit code set calling sys.exit
appropriate argument. seems way access replacing original sys.exit
wrapper:
import atexit import sys exit_code = none original_exit = none def my_exit(code=0): global exit_code exit_code = code original_exit(code) original_exit = sys.exit sys.exit = my_exit @atexit.register def my_exit_handler(): print "exit code is", exit_code if __name__ == '__main__': sys.exit(1)
if need more information in case of error want use custom wrapper sys.excepthook
. there's scons.script.getbuildfailures
.
Comments
Post a Comment