mirror of https://github.com/ArduPilot/ardupilot
waf: let wrapper exit with error
It's not useful to raise an excpetion because it will only report the command called exit with an error. Just return an error code instead of rasing an exception. This way we get nicer error messages: ./waf unknowncommand No function unknowncommand defined in /home/lucas/p/dronecode/ardupilot/wscript vs ./waf unknowncommand No function unknowncommand defined in /home/lucas/p/dronecode/ardupilot/wscript Traceback (most recent call last): File "./waf", line 15, in <module> raise e subprocess.CalledProcessError: Command '['python', '/home/lucas/p/dronecode/ardupilot/modules/waf/waf-light', 'unknowncommand']' returned non-zero exit status 1
This commit is contained in:
parent
4b2eedac05
commit
0ad3b0421f
|
@ -12,7 +12,7 @@ try:
|
||||||
subprocess.check_call(['python', waf_light] + sys.argv[1:])
|
subprocess.check_call(['python', waf_light] + sys.argv[1:])
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
if e.returncode != 2 or p.isfile(waf_light):
|
if e.returncode != 2 or p.isfile(waf_light):
|
||||||
raise e
|
sys.exit(1)
|
||||||
|
|
||||||
print('Missing waf submodule. Trying to get it')
|
print('Missing waf submodule. Trying to get it')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue