def _del_tty(self): if self.mode: # restore the tty mode for stdout tty.tcsetattr(pty.STDIN_FILENO, tty.TCSAFLUSH, self.mode)