Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
33499:0407a51b9d8c | 33500:9c6e64911de0 |
---|---|
87 origenviron = os.environ.copy() | 87 origenviron = os.environ.copy() |
88 osenvironb = getattr(os, 'environb', os.environ) | 88 osenvironb = getattr(os, 'environb', os.environ) |
89 processlock = threading.Lock() | 89 processlock = threading.Lock() |
90 | 90 |
91 with_color = False | 91 with_color = False |
92 try: # is pygments installed | 92 |
93 import pygments | 93 # ANSI color is unsupported prior to Windows 10 |
94 import pygments.lexers as lexers | 94 if os.name != 'nt': |
95 import pygments.formatters as formatters | 95 try: # is pygments installed |
96 with_color = True | 96 import pygments |
97 except ImportError: | 97 import pygments.lexers as lexers |
98 pass | 98 import pygments.formatters as formatters |
99 with_color = True | |
100 except ImportError: | |
101 pass | |
99 | 102 |
100 if not sys.stderr.isatty(): # check if the terminal is capable | 103 if not sys.stderr.isatty(): # check if the terminal is capable |
101 with_color = False | 104 with_color = False |
102 | 105 |
103 if sys.version_info > (3, 5, 0): | 106 if sys.version_info > (3, 5, 0): |