Merge "Treat ^C as "no" at confirmation prompt"

This commit is contained in:
Zuul 2022-04-11 05:18:26 +00:00 committed by Gerrit Code Review
commit bb58ee198c

View File

@ -1005,7 +1005,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)