mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-23 07:34:44 +00:00
Python3: fix strformat unicode_safe()
This commit is contained in:
parent
e11ba8e427
commit
acaf8e671e
1 changed files with 6 additions and 1 deletions
|
|
@ -59,7 +59,12 @@ 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(str(s), encoding, errors)
|
||||
|
||||
try:
|
||||
ret_str = unicode(str(s), encoding, errors)
|
||||
except NameError:
|
||||
ret_str = s
|
||||
return ret_str
|
||||
|
||||
|
||||
def ascii_safe (s):
|
||||
|
|
|
|||
Loading…
Reference in a new issue