Skip to content

Commit

Permalink
Prevent file stream from being incorrectly wrapped on Pycharm
Browse files Browse the repository at this point in the history
  • Loading branch information
Delgan committed May 17, 2018
1 parent e19cbb7 commit f19ec6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion colorama/ansitowin32.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def is_stream_closed(stream):


def is_a_tty(stream):
if 'PYCHARM_HOSTED' in os.environ:
if 'PYCHARM_HOSTED' in os.environ and (stream is sys.__stdout__ or stream is sys.__stderr__):
return True
return (hasattr(stream, 'isatty') and stream.isatty())

Expand Down

0 comments on commit f19ec6f

Please sign in to comment.