Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for PyCharm #163

Merged
merged 3 commits into from
May 3, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion colorama/ansitowin32.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def is_stream_closed(stream):


def is_a_tty(stream):
return hasattr(stream, 'isatty') and stream.isatty()
is_pycharm = 'PYCHARM_HOSTED' in os.environ
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will look better if we do:
if 'PYCHARM_HOSTED' in os.environ: return True and then leave the original return as it was. This is not important, though - what do you think?

return (hasattr(stream, 'isatty') and stream.isatty()) or is_pycharm


class StreamWrapper(object):
Expand Down