mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-24 02:40:26 +01:00
Python 2 encoding enhancements - Issue 2230
This commit is contained in:
parent
9f2ce1b776
commit
5e90de89d8
@ -237,7 +237,10 @@ class formatter(logging.Formatter):
|
||||
if rec.levelno >= logging.INFO:
|
||||
# the goal of this is to format without the leading "Logs, hour" prefix
|
||||
if rec.args:
|
||||
return msg % rec.args
|
||||
try:
|
||||
return msg % rec.args
|
||||
except UnicodeDecodeError:
|
||||
return msg.encode('utf-8') % rec.args
|
||||
return msg
|
||||
|
||||
rec.msg = msg
|
||||
|
@ -604,6 +604,12 @@ def h_list(lst):
|
||||
"""
|
||||
return md5(repr(lst).encode()).digest()
|
||||
|
||||
if sys.hexversion < 0x3000000:
|
||||
def h_list_python2(lst):
|
||||
return md5(repr(lst)).digest()
|
||||
h_list_python2.__doc__ = h_list.__doc__
|
||||
h_list = h_list_python2
|
||||
|
||||
def h_fun(fun):
|
||||
"""
|
||||
Hash functions
|
||||
|
Loading…
Reference in New Issue
Block a user