summaryrefslogtreecommitdiff
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
commit02c0707a343fa066351070645b7f9c9feedd246f (patch)
tree7730d720dbd8d95ed3e6dcf88f9905c9386b7105
parentf986495f43ddaf5cdf39fcf34d28cbc6669099f1 (diff)
downloadsphinx-02c0707a343fa066351070645b7f9c9feedd246f.tar.gz
Added support for Windows color output using colorama (if installed)
-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 c2330102..508d895f 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)