fix bug in logger

This commit is contained in:
Ricter Z 2016-10-19 12:55:09 +08:00
parent bb5024f1d7
commit a3fb75eb11

View File

@ -4,11 +4,11 @@
from __future__ import print_function, unicode_literals from __future__ import print_function, unicode_literals
import logging import logging
import re import re
import subprocess import platform
import sys import sys
if subprocess.mswindows: if platform.system() == 'Windows':
import ctypes import ctypes
import ctypes.wintypes import ctypes.wintypes
@ -49,7 +49,7 @@ class ColorizingStreamHandler(logging.StreamHandler):
isatty = getattr(self.stream, 'isatty', None) isatty = getattr(self.stream, 'isatty', None)
return isatty and isatty() and not self.disable_coloring return isatty and isatty() and not self.disable_coloring
if not subprocess.mswindows: if not platform.system() == 'Windows':
def output_colorized(self, message): def output_colorized(self, message):
self.stream.write(message) self.stream.write(message)
else: else: