diff options
author | Tim Burke <tim.burke@gmail.com> | 2022-04-07 16:38:51 -0700 |
---|---|---|
committer | Tim Burke <tim.burke@gmail.com> | 2022-04-07 16:39:41 -0700 |
commit | 8cbd515e0c1a4b9d30aed7089ce64c79c1bda6e7 (patch) | |
tree | 742ac8bd1618753522784dda995a9f8755ebd883 | |
parent | 18189abf59723b8f754b6e0fea72e9de18d2067f (diff) | |
download | git-review-8cbd515e0c1a4b9d30aed7089ce64c79c1bda6e7.tar.gz |
Treat ^C as "no" at confirmation prompt
The user intent is clear.
Change-Id: Ibdaa2f95e7417619f651d6f41fbf15a357839bf3
-rw-r--r-- | git_review/cmd.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/git_review/cmd.py b/git_review/cmd.py index b3e7e38..b087867 100644 --- a/git_review/cmd.py +++ b/git_review/cmd.py @@ -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) |