core: some tweaks for better colour handling when we're redirecting stdout/stderr
This commit is contained in:
parent
6f6be5c78e
commit
c25ab51664
3 changed files with 8 additions and 3 deletions
|
@ -16,7 +16,7 @@ def _colorize(x: str, color: Optional[str]=None) -> str:
|
|||
if color is None:
|
||||
return x
|
||||
|
||||
if not sys.stdout.isatty():
|
||||
if not sys.stderr.isatty():
|
||||
return x
|
||||
# click handles importing/initializing colorama if necessary
|
||||
# on windows it installs it if necessary
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue