Commit 09e0d052 by James Tanner

Ensure sys.stdout has an istty method

parent d7c8cf6c
......@@ -745,9 +745,10 @@ class Runner(object):
data = result.result
# https://github.com/ansible/ansible/issues/4958
if "stdout" in data and sys.stdout.isatty():
if not string_functions.isprintable(data['stdout']):
data['stdout'] = ''
if hasattr(sys.stdout, "isatty"):
if "stdout" in data and sys.stdout.isatty():
if not string_functions.isprintable(data['stdout']):
data['stdout'] = ''
if 'item' in inject:
result.result['item'] = inject['item']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment