summaryrefslogtreecommitdiff
path: root/sphinx/util/console.py
diff options
context:
space:
mode:
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)