From 511c7c858d6cd99b66b0cd7fc187dc73034bb3fa Mon Sep 17 00:00:00 2001 From: Atte Virtanen Date: Fri, 19 Jul 2013 11:06:31 +0300 Subject: [PATCH] Check for existence of isatty on stdout before calling it --- lib/ansible/color.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/color.py b/lib/ansible/color.py index a7124ec34d..5d10852003 100644 --- a/lib/ansible/color.py +++ b/lib/ansible/color.py @@ -21,7 +21,7 @@ import sys ANSIBLE_COLOR=True if os.getenv("ANSIBLE_NOCOLOR") is not None: ANSIBLE_COLOR=False -elif not sys.stdout.isatty(): +elif not hasattr(sys.stdout, 'isatty') or not sys.stdout.isatty(): ANSIBLE_COLOR=False else: try: