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: