mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
ChannelLogger: Fix Python 2 compatibility (again).
This commit is contained in:
parent
0c58ab2e98
commit
427033d8e8
@ -164,7 +164,7 @@ class ChannelLogger(callbacks.Plugin):
|
|||||||
if format:
|
if format:
|
||||||
string = time.strftime(format) + ' '
|
string = time.strftime(format) + ' '
|
||||||
if sys.version_info[0] < 3:
|
if sys.version_info[0] < 3:
|
||||||
string = string.decode()
|
string = string.decode('utf8', 'ignore')
|
||||||
log.write(string)
|
log.write(string)
|
||||||
|
|
||||||
def normalizeChannel(self, irc, channel):
|
def normalizeChannel(self, irc, channel):
|
||||||
@ -181,7 +181,7 @@ class ChannelLogger(callbacks.Plugin):
|
|||||||
if self.registryValue('stripFormatting', channel):
|
if self.registryValue('stripFormatting', channel):
|
||||||
s = ircutils.stripFormatting(s)
|
s = ircutils.stripFormatting(s)
|
||||||
if sys.version_info[0] < 3:
|
if sys.version_info[0] < 3:
|
||||||
s = s.decode()
|
s = s.decode('utf8', 'ignore')
|
||||||
log.write(s)
|
log.write(s)
|
||||||
if self.registryValue('flushImmediately'):
|
if self.registryValue('flushImmediately'):
|
||||||
log.flush()
|
log.flush()
|
||||||
|
Loading…
Reference in New Issue
Block a user