mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-29 18:44:43 +00:00
Merge pull request #274 from cjmayo/python3_24
{python3_24} Python3: fix logger
This commit is contained in:
commit
4e6c806bff
1 changed files with 3 additions and 2 deletions
|
|
@ -25,6 +25,7 @@ import time
|
|||
import codecs
|
||||
import abc
|
||||
from .. import log, LOG_CHECK, strformat, dummy, configuration, i18n
|
||||
from builtins import str as str_text
|
||||
|
||||
_ = lambda x: x
|
||||
Fields = dict(
|
||||
|
|
@ -207,7 +208,7 @@ class _Logger (object):
|
|||
|
||||
def encode (self, s):
|
||||
"""Encode string with output encoding."""
|
||||
assert isinstance(s, unicode)
|
||||
assert isinstance(s, str_text)
|
||||
return s.encode(self.output_encoding, self.codec_errors)
|
||||
|
||||
def init_fileoutput (self, args):
|
||||
|
|
@ -323,7 +324,7 @@ class _Logger (object):
|
|||
"""
|
||||
Write string to output descriptor plus a newline.
|
||||
"""
|
||||
self.write(u"%s%s" % (s, unicode(os.linesep)), **args)
|
||||
self.write(u"%s%s" % (s, str_text(os.linesep)), **args)
|
||||
|
||||
def has_part (self, name):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue