10000 Merge pull request #142 from twilio/ifisatty · twilio/twilio-python@670a6ba · GitHub
[go: up one dir, main page]

Skip to content

Commit 670a6ba

Browse files
author
Kevin Burke
committed
Merge pull request #142 from twilio/ifisatty
check if isatty attr exists
2 parents 19898c7 + 5e42a74 commit 670a6ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

twilio/rest/resources/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def teal(msg):
155155
# If it makes sense to print a human readable error message, try to do
156156
# it. The one problem is that someone might catch this error and try to
157157
# display the message from it to an end user.
158-
if sys.stderr.isatty():
158+
if hasattr(sys.stderr, 'isatty') and sys.stderr.isatty():
159159
msg = red("\nHTTP Error. ")
160160
msg += white("Your request was:\n\n")
161161
msg += teal("%s %s" % (method, uri))

0 commit comments

Comments
 (0)
0