mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Filter: Fix encoding issue on Python 3.
This commit is contained in:
parent
4d801a02c5
commit
53c7c9beaa
@ -412,8 +412,12 @@ class Filter(callbacks.Plugin):
|
||||
|
||||
Returns <text> colorized like a rainbow.
|
||||
"""
|
||||
if sys.version_info[0] < 3:
|
||||
text = text.decode('utf-8')
|
||||
colors = utils.iter.cycle(['04', '07', '08', '03', '02', '12', '06'])
|
||||
L = [self._color(c, fg=colors.next()) for c in text]
|
||||
if sys.version_info[0] < 3:
|
||||
L = [c.encode('utf-8') for c in L]
|
||||
irc.reply(''.join(L) + '\x03')
|
||||
rainbow = wrap(rainbow, ['text'])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user