From 3bdb1eae0bfc94b54224b5c5a55d8aeac988ac93 Mon Sep 17 00:00:00 2001 From: Skami18 Date: Fri, 14 Oct 2011 17:21:03 +0200 Subject: [PATCH] Pelican no more use ANSI codes on Windows (CMD.exe don't support it) --- pelican/log.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pelican/log.py b/pelican/log.py index ac4420ba..b7167dfc 100644 --- a/pelican/log.py +++ b/pelican/log.py @@ -66,7 +66,8 @@ class DummyFormatter(object): """ def __new__(cls, *args, **kwargs): - if os.isatty(sys.stdout.fileno()): # thanks to http://stackoverflow.com/questions/2086961/how-can-i-determine-if-a-python-script-is-executed-from-crontab/2087031#2087031 + if os.isatty(sys.stdout.fileno())\ + and not sys.platform.startswith('win'): return ANSIFormatter(*args, **kwargs) else: return TextFormatter( *args, **kwargs)