From 907b5bf10a051c9bf866483119165c9bf52f3094 Mon Sep 17 00:00:00 2001 From: Sam Zaydel Date: Mon, 30 Aug 2021 15:14:11 -0700 Subject: [PATCH] Treat KeyboardInterrupt exception as != YES --- client/resource.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/client/resource.py b/client/resource.py index bfba9a1..6088640 100644 --- a/client/resource.py +++ b/client/resource.py @@ -335,14 +335,16 @@ def _processResponse(session, resource, response, schema, cache, data): print() print("== To proceed, enter 'YES': ", end="") sys.stdout.flush() - - if sys.stdin.readline() != "YES\n": - print("== Aborted") + try: + if sys.stdin.readline() != "YES\n": + print("== Aborted") + return + + print("== Confirmed, proceeding") + print() + except KeyboardInterrupt: + print("\n== Aborted") return - - print("== Confirmed, proceeding") - print() - # Reissue the request with the URL we got. return process(session, resource, url)