2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-25 19:30:04 +01:00

Do not force an encoding on config.log on python2 #1974

This commit is contained in:
Thomas Nagy 2017-07-19 22:38:12 +02:00
parent 963c3bfd0c
commit 2fe4083f13
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA

View File

@ -328,7 +328,11 @@ def make_logger(path, name):
:type name: string
"""
logger = logging.getLogger(name)
hdlr = logging.FileHandler(path, 'w', encoding=sys.stdout.encoding)
if sys.hexversion > 0x3000000:
encoding = sys.stdout.encoding
else:
encoding = None
hdlr = logging.FileHandler(path, 'w', encoding=encoding)
formatter = logging.Formatter('%(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)