Patchwork D118: run-tests: remove unnecessary 'with_color' variable

login
register
mail settings
Submitter phabricator
Date July 18, 2017, 4:36 a.m.
Message ID <17f7c8c7e6913c04bd096c244e76ea36@localhost.localdomain>
Download mbox | patch
Permalink /patch/22471/
State Not Applicable, archived
Headers show

Comments

phabricator - July 18, 2017, 4:36 a.m.
martinvonz updated this revision to Diff 234.
martinvonz marked an inline comment as done.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D118?vs=229&id=234

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
Cc: quark, mercurial-devel

Patch

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
@@ -414,15 +412,15 @@ 
                      '(use --with-chg instead)')
 
     if options.color == 'auto':
-        options.color = with_color
+        options.color = pygmentspresent
         if not sys.stderr.isatty(): # check if the terminal is capable
             options.color = False
     elif options.color == 'never':
         options.color = False
     else: # 'always', for testing purposes
         options.color = pygmentspresent
         if not pygmentspresent:
-            sys.stderr.write('warning: --color=always ignored because'
+            sys.stderr.write('warning: --color=always ignored because '
                              'pygments is not installed\n')
 
     global useipv6