def out(self, obj):
if platform.system() == 'Windows':
self.file = colorama.AnsiToWin32(self.file).stream
output = self.formatter(obj)
try:
print(output, file=self.file, end='')
except IOError as ex:
if ex.errno == errno.EPIPE:
pass
else:
raise
except UnicodeEncodeError:
print(output.encode('ascii', 'ignore').decode('utf-8', 'ignore'),
file=self.file, end='')
评论列表
文章目录