mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Check for existence of isatty on stdout before calling it
This commit is contained in:
@@ -21,7 +21,7 @@ import sys
|
|||||||
ANSIBLE_COLOR=True
|
ANSIBLE_COLOR=True
|
||||||
if os.getenv("ANSIBLE_NOCOLOR") is not None:
|
if os.getenv("ANSIBLE_NOCOLOR") is not None:
|
||||||
ANSIBLE_COLOR=False
|
ANSIBLE_COLOR=False
|
||||||
elif not sys.stdout.isatty():
|
elif not hasattr(sys.stdout, 'isatty') or not sys.stdout.isatty():
|
||||||
ANSIBLE_COLOR=False
|
ANSIBLE_COLOR=False
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user