squash! Python3: fix strformat ascii_safe() and unicode_safe()

From:
fixes for Python 3: fix running problems in Python 3
This commit is contained in:
Petr Dlouhý 2019-04-28 16:20:30 +01:00 committed by anarcat
parent a1c6c4935e
commit e11ba8e427

View file

@ -59,7 +59,7 @@ def unicode_safe (s, encoding=i18n.default_encoding, errors='replace'):
if isinstance(s, str_text):
# s is already unicode, nothing to do
return s
return str_text(bytes(s), encoding, errors)
return str_text(str(s), encoding, errors)
def ascii_safe (s):