From patchwork Tue Jul 18 19:27:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D118: run-tests: remove unnecessary 'with_color' variable From: phabricator X-Patchwork-Id: 22517 Message-Id: <96e84873598dd1742be80406db63b80e@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Tue, 18 Jul 2017 19:27:27 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHGda8bdeb1be28: run-tests: remove unnecessary 'with_color' variable (authored by martinvonz). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D118?vs=259&id=286 REVISION DETAIL https://phab.mercurial-scm.org/D118 AFFECTED FILES tests/run-tests.py CHANGE DETAILS EMAIL PREFERENCES https://phab.mercurial-scm.org/settings/panel/emailpreferences/ To: martinvonz, #hg-reviewers, krbullock Cc: krbullock, quark, mercurial-devel diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -88,15 +88,13 @@ osenvironb = getattr(os, 'environb', os.environ) processlock = threading.Lock() -with_color = False pygmentspresent = False # 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 pygmentspresent = True except ImportError: pass @@ -1569,7 +1567,7 @@ self.faildata = {} if options.color == 'auto': - self.color = with_color and self.stream.isatty() + self.color = pygmentspresent and self.stream.isatty() elif options.color == 'never': self.color = False else: # 'always', for testing purposes