mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-11 16:13:11 +00:00
Python3: fix strformat for test_file
This commit is contained in:
parent
acaf8e671e
commit
ac14585a78
1 changed files with 4 additions and 4 deletions
|
|
@ -61,10 +61,10 @@ def unicode_safe (s, encoding=i18n.default_encoding, errors='replace'):
|
|||
return s
|
||||
|
||||
try:
|
||||
ret_str = unicode(str(s), encoding, errors)
|
||||
except NameError:
|
||||
ret_str = s
|
||||
return ret_str
|
||||
return unicode(str(s), encoding, errors)
|
||||
except NameError: # Python3
|
||||
if isinstance(s, bytes):
|
||||
return s.decode("utf-8", errors)
|
||||
|
||||
|
||||
def ascii_safe (s):
|
||||
|
|
|
|||
Loading…
Reference in a new issue