mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #47775 from gtmanfred/2017.7.6
catch UnsupportedOperation with AssertionError
This commit is contained in:
commit
edf94c915e
1 changed files with 3 additions and 1 deletions
|
@ -7,6 +7,8 @@ for managing outputters.
|
|||
# Import python libs
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import
|
||||
|
||||
import io
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
|
@ -169,7 +171,7 @@ def get_printout(out, opts=None, **kwargs):
|
|||
'''
|
||||
try:
|
||||
fileno = sys.stdout.fileno()
|
||||
except AttributeError:
|
||||
except (AttributeError, io.UnsupportedOperation):
|
||||
fileno = -1 # sys.stdout is StringIO or fake
|
||||
return not os.isatty(fileno)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue