Check for existence of isatty on stdout before calling it

This commit is contained in:
Atte Virtanen 2013-07-19 11:06:31 +03:00
parent c3a8b6ff07
commit 511c7c858d

View file

@ -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: