Skip to content

Commit

Permalink
Merge pull request #3506 from vyos/mergify/bp/sagitta/pr-3502
Browse files Browse the repository at this point in the history
vyos.utils.io: T6385: handle keyboard interrupts in ask_yes_no (backport #3502)
  • Loading branch information
c-po authored May 22, 2024
2 parents 82b14fb + 616ede0 commit 434222b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/vyos/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down

0 comments on commit 434222b

Please sign in to comment.