diff options
| author | Christian Breunig <christian@breunig.cc> | 2024-05-22 20:13:18 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-22 20:13:18 +0200 | 
| commit | 409c9708874cb15d63b886f1e69cdb7a0fac4116 (patch) | |
| tree | f2b7fa13a8cb9136348cc7f6ac2d7e0801a2f11e /python | |
| parent | 252ae4b0b9519c97164e8901ce192e104827102d (diff) | |
| parent | 5a5dda14fd3d472680568f1792e9fbdb030f3995 (diff) | |
| download | vyos-1x-409c9708874cb15d63b886f1e69cdb7a0fac4116.tar.gz vyos-1x-409c9708874cb15d63b886f1e69cdb7a0fac4116.zip | |
Merge pull request #3502 from dmbaturin/T6385-yes-no-ctrl-c
vyos.utils.io: T6385: handle keyboard interrupts in ask_yes_no
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/utils/io.py | 2 | 
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.""" | 
