diff options
author | Segev Finer <segev208@gmail.com> | 2017-06-03 17:49:24 +0300 |
---|---|---|
committer | Segev Finer <segev208@gmail.com> | 2017-06-11 21:04:12 +0300 |
commit | 17cae05fa5971e6f4b6e03463e2089378fc523be (patch) | |
tree | 5c38ac679f3ae0eb999abc9f0f8cf946ad7f4d43 /sphinx/make_mode.py | |
parent | 32cb60ade3f839cd223d63184aefb3ecf92278dd (diff) | |
download | sphinx-git-17cae05fa5971e6f4b6e03463e2089378fc523be.tar.gz |
Fix color handling in make mode's help command
This will make it enable colorama on Windows when it's available and
will prevent it from printing escapes sequences if the console doesn't
support colors.
Diffstat (limited to 'sphinx/make_mode.py')
-rw-r--r-- | sphinx/make_mode.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sphinx/make_mode.py b/sphinx/make_mode.py index 512dc5be3..9fe7ecebf 100644 --- a/sphinx/make_mode.py +++ b/sphinx/make_mode.py @@ -22,7 +22,7 @@ from os import path import sphinx from sphinx import cmdline -from sphinx.util.console import bold, blue # type: ignore +from sphinx.util.console import color_terminal, nocolor, bold, blue # type: ignore from sphinx.util.osutil import cd, rmtree if False: @@ -87,6 +87,9 @@ class Make(object): def build_help(self): # type: () -> None + if not color_terminal(): + nocolor() + print(bold("Sphinx v%s" % sphinx.__display_version__)) print("Please use `make %s' where %s is one of" % ((blue('target'),) * 2)) # type: ignore # NOQA for osname, bname, description in BUILDERS: |