Treat ^C as "no" at confirmation prompt

The user intent is clear.

Change-Id: Ibdaa2f95e7417619f651d6f41fbf15a357839bf3
This commit is contained in:
Tim Burke
2022-04-07 16:38:51 -07:00
parent 18189abf59
commit 8cbd515e0c

View File

@@ -968,7 +968,10 @@ def assert_one_change(remote, branch, yes, have_hook):
"branches (for independent changes).")
print("\nThe outstanding commits are:\n\n%s\n\n"
"Do you really want to submit the above commits?" % output)
yes_no = input("Type 'yes' to confirm, other to cancel: ")
try:
yes_no = input("Type 'yes' to confirm, other to cancel: ")
except KeyboardInterrupt:
yes_no = "no"
if yes_no.lower().strip() != "yes":
print("Aborting.")
sys.exit(1)