Fixed colorized output on Windows with Python 3.

Closes #87.
This commit is contained in:
Jakub Roztocil committed 2012-08-17 06:35:18 +02:00
1 parent 86256af1df
commit 4660da949f
5 files changed
+56 -20

No files matched your search

+7 -5
View File
@@ -18,14 +18,16 @@ class Environment(object):
if progname not in ['http', 'https']:
progname = 'http'
if is_windows:
import colorama.initialise
colorama.initialise.init()
stdin_isatty = sys.stdin.isatty()
stdin = sys.stdin
stdout_isatty = sys.stdout.isatty()
stdout = sys.stdout
if stdout_isatty and is_windows:
from colorama.initialise import wrap_stream
stdout = wrap_stream(sys.stdout, convert=None,
strip=None, autoreset=True, wrap=True)
else:
stdout = sys.stdout
stderr = sys.stderr
# Can be set to 0 to disable colors completely.