catch UnsupportedOperation with AssertionError

This commit is contained in:
Daniel Wallace 2018-05-22 11:56:00 -05:00
parent 8c38ecd75f
commit 548f65d056
No known key found for this signature in database
GPG key ID: 5FA5E5544F010D48

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)