autotest: re-raise KeyboardInterrupt after closing pexpects

this gives a stack trace, which is handy if the tests get caught
indefinitely somewhere
This commit is contained in:
Peter Barker 2021-01-09 14:38:02 +11:00 committed by Peter Barker
parent f53892a1fa
commit 8e6d144d72

View File

@ -1040,8 +1040,9 @@ if __name__ == "__main__":
if not run_tests(steps_to_run):
sys.exit(1)
except KeyboardInterrupt:
print("KeyboardInterrupt caught; closing pexpect connections")
util.pexpect_close_all()
sys.exit(1)
raise
except Exception:
# make sure we kill off any children
util.pexpect_close_all()