Mercurial > public > mercurial-scm > hg-stable
diff tests/run-tests.py @ 33500:9c6e64911de0
run-tests: disable color on Windows
More Windows sadness. Maybe someone can figure out how to make win32 color
work, but I think we avoid importing stuff from the mercurial package in this
module. On the plus side, this conditionalizes away a test failure.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 15 Jul 2017 00:52:36 -0400 |
parents | e80041832eec |
children | 754569f5e999 |
line wrap: on
line diff
--- a/tests/run-tests.py Fri Jul 14 14:22:40 2017 -0700 +++ b/tests/run-tests.py Sat Jul 15 00:52:36 2017 -0400 @@ -89,13 +89,16 @@ processlock = threading.Lock() with_color = False -try: # is pygments installed - import pygments - import pygments.lexers as lexers - import pygments.formatters as formatters - with_color = True -except ImportError: - pass + +# ANSI color is unsupported prior to Windows 10 +if os.name != 'nt': + try: # is pygments installed + import pygments + import pygments.lexers as lexers + import pygments.formatters as formatters + with_color = True + except ImportError: + pass if not sys.stderr.isatty(): # check if the terminal is capable with_color = False