mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-25 00:24:45 +00:00
Python3: fix test error message
This commit is contained in:
parent
1590408a65
commit
1b41df4af3
1 changed files with 3 additions and 2 deletions
|
|
@ -238,8 +238,9 @@ class LinkCheckTest (unittest.TestCase):
|
|||
|
||||
def fail_unicode (self, msg):
|
||||
"""Print encoded fail message."""
|
||||
# XXX self.fail() only supports ascii
|
||||
msg = msg.encode("ascii", "replace")
|
||||
# XXX self.fail() only supports ascii on Python 2
|
||||
if not isinstance(msg, str) and isinstance(msg, str_text): # this can be true only on Python 2
|
||||
msg = msg.encode("ascii", "backslashreplace")
|
||||
self.fail(msg)
|
||||
|
||||
def direct (self, url, resultlines, parts=None, recursionlevel=0,
|
||||
|
|
|
|||
Loading…
Reference in a new issue