Merge pull request #47775 from gtmanfred/2017.7.6

catch UnsupportedOperation with AssertionError
This commit is contained in:
Nicole Thomas 2018-05-22 15:04:12 -04:00 committed by GitHub
commit edf94c915e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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