From 5e59acf937c3bb9cfe6a3b7a0a264b9df00239ee Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Tue, 10 Oct 2023 04:00:22 -0400 Subject: Add handling of signal interrupt and EOF at input prompts (#2154) --- archinstall/lib/interactions/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'archinstall/lib/interactions/utils.py') diff --git a/archinstall/lib/interactions/utils.py b/archinstall/lib/interactions/utils.py index f6b5b2d3..fdbb4625 100644 --- a/archinstall/lib/interactions/utils.py +++ b/archinstall/lib/interactions/utils.py @@ -17,7 +17,12 @@ def get_password(prompt: str = '') -> Optional[str]: if not prompt: prompt = _("Enter a password: ") - while password := getpass.getpass(prompt): + while True: + try: + password = getpass.getpass(prompt) + except (KeyboardInterrupt, EOFError): + break + if len(password.strip()) <= 0: break -- cgit v1.2.3-70-g09d2