summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-05-22 21:09:33 +0200
committerGitHub <noreply@github.com>2024-05-22 21:09:33 +0200
commit434222b8dbc5d906501c56deb76491bdc190c814 (patch)
tree22f59184b73580d273e551990ea1e91b5e3fd720
parent82b14fb2bb89eb93eb9b5275b1d94d1bc61d0806 (diff)
parent616ede08a69a8f42c23b648f41997914e660a943 (diff)
downloadvyos-1x-434222b8dbc5d906501c56deb76491bdc190c814.tar.gz
vyos-1x-434222b8dbc5d906501c56deb76491bdc190c814.zip
Merge pull request #3506 from vyos/mergify/bp/sagitta/pr-3502
vyos.utils.io: T6385: handle keyboard interrupts in ask_yes_no (backport #3502)
-rw-r--r--python/vyos/utils/io.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/python/vyos/utils/io.py b/python/vyos/utils/io.py
index a8c430f28..205210b66 100644
--- a/python/vyos/utils/io.py
+++ b/python/vyos/utils/io.py
@@ -72,6 +72,8 @@ def ask_yes_no(question, default=False) -> bool:
stdout.write("Please respond with yes/y or no/n\n")
except EOFError:
stdout.write("\nPlease respond with yes/y or no/n\n")
+ except KeyboardInterrupt:
+ return False
def is_interactive():
"""Try to determine if the routine was called from an interactive shell."""