mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Fix FileHandler having ANSI escapes when used within PyCharm
This commit is contained in:
parent
c6162cfec5
commit
c57d488ca6
@ -1243,11 +1243,12 @@ def is_docker() -> bool:
|
||||
|
||||
|
||||
def stream_supports_colour(stream: Any) -> bool:
|
||||
is_a_tty = hasattr(stream, 'isatty') and stream.isatty()
|
||||
|
||||
# Pycharm and Vscode support colour in their inbuilt editors
|
||||
if 'PYCHARM_HOSTED' in os.environ or os.environ.get('TERM_PROGRAM') == 'vscode':
|
||||
return True
|
||||
return is_a_tty
|
||||
|
||||
is_a_tty = hasattr(stream, 'isatty') and stream.isatty()
|
||||
if sys.platform != 'win32':
|
||||
# Docker does not consistently have a tty attached to it
|
||||
return is_a_tty or is_docker()
|
||||
|
Loading…
x
Reference in New Issue
Block a user