From f2fed4a8b50fc21d6703540c740114206fbceb08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Sat, 17 May 2014 22:03:52 +0200 Subject: [PATCH] [fix] Prevent freeze in the cli if it's not running from a tty --- moulinette/interfaces/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/moulinette/interfaces/cli.py b/moulinette/interfaces/cli.py index c169cda3..a4983e38 100644 --- a/moulinette/interfaces/cli.py +++ b/moulinette/interfaces/cli.py @@ -168,9 +168,10 @@ class Interface(BaseInterface): m18n.set_locale(get_locale()) # Connect signals to handlers - msignals.set_handler('authenticate', self._do_authenticate) msignals.set_handler('display', self._do_display) - msignals.set_handler('prompt', self._do_prompt) + if os.isatty(1): + msignals.set_handler('authenticate', self._do_authenticate) + msignals.set_handler('prompt', self._do_prompt) self.actionsmap = actionsmap