summaryrefslogtreecommitdiff
path: root/sphinx/util/console.py
diff options
context:
space:
mode:
authorrneu31 <rneu31@gmail.com>2014-07-03 20:23:00 +0000
committerrneu31 <rneu31@gmail.com>2014-07-03 20:23:00 +0000
commit0058b4d4bb0450e53f5daa9423942a40b3f70f1e (patch)
tree7730d720dbd8d95ed3e6dcf88f9905c9386b7105 /sphinx/util/console.py
parent4883e1eba27f614cda6582f77c70d328c960902e (diff)
downloadsphinx-git-0058b4d4bb0450e53f5daa9423942a40b3f70f1e.tar.gz
Added support for Windows color output using colorama (if installed)
Diffstat (limited to 'sphinx/util/console.py')
-rw-r--r--sphinx/util/console.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/sphinx/util/console.py b/sphinx/util/console.py
index c2330102d..508d895fc 100644
--- a/sphinx/util/console.py
+++ b/sphinx/util/console.py
@@ -55,7 +55,12 @@ def color_terminal():
def nocolor():
- codes.clear()
+ # check if colorama is installed to support color on Windows
+ try:
+ import colorama
+ colorama.init()
+ except ImportError:
+ codes.clear()
def coloron():
codes.update(_orig_codes)