Bug 823787 - Make profilerserver.py use a non-zero exit code on failure. r=ted.

--HG--
extra : rebase_source : 2e7d1ec773dfc286c57832ea3d907f0b18af8908
This commit is contained in:
Nicholas Nethercote 2013-12-12 14:08:40 -08:00
parent 9a8b0c002e
commit 3c5ef2a93f

View File

@ -65,7 +65,15 @@ if __name__ == '__main__':
cmdargs=cmdargs,
env=env)
runner.start(debug_args=debug_args, interactive=interactive)
runner.wait()
status = runner.wait()
httpd.stop()
if status != 0:
status = 1 # normalize status, in case it's larger than 127
# Note: the |finally| block below will always run.
# http://docs.python.org/2/library/sys.html#sys.exit says that sys.exit "is
# implemented by raising the SystemExit exception, so cleanup actions
# specified by finally clauses of try statements are honored".
sys.exit(status)
finally:
shutil.rmtree(profilePath)