diff --git a/tools/terminal_tool.py b/tools/terminal_tool.py index 8af8c9d2fe8c..66889a10042f 100644 --- a/tools/terminal_tool.py +++ b/tools/terminal_tool.py @@ -209,7 +209,7 @@ def read_password_thread(): break chars.append(b) result["password"] = b"".join(chars).decode("utf-8", errors="replace") - except (EOFError, KeyboardInterrupt, OSError): + except (EOFError, KeyboardInterrupt, OSError, ImportError, NotImplementedError): result["password"] = "" except Exception: result["password"] = "" @@ -218,12 +218,12 @@ def read_password_thread(): try: import termios as _termios _termios.tcsetattr(tty_fd, _termios.TCSAFLUSH, old_attrs) - except Exception: + except (Exception, ImportError, NotImplementedError): pass if tty_fd is not None: try: os.close(tty_fd) - except Exception: + except (Exception, ImportError, NotImplementedError): pass result["done"] = True