mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-128595: Default to stdout isatty for colour detection instead of stderr (#128498)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
a429159797
commit
6f167d7134
8 changed files with 38 additions and 23 deletions
|
@ -1558,7 +1558,7 @@ class DocTestRunner:
|
|||
save_displayhook = sys.displayhook
|
||||
sys.displayhook = sys.__displayhook__
|
||||
saved_can_colorize = _colorize.can_colorize
|
||||
_colorize.can_colorize = lambda: False
|
||||
_colorize.can_colorize = lambda *args, **kwargs: False
|
||||
color_variables = {"PYTHON_COLORS": None, "FORCE_COLOR": None}
|
||||
for key in color_variables:
|
||||
color_variables[key] = os.environ.pop(key, None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue