diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2012-09-16 22:48:48 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2012-09-16 22:48:48 +0200 |
commit | 370c7671da693aeb3dce730694b4d0ea2e63c554 (patch) | |
tree | 2fdb4680037b368e16b194021e48e87da15dd317 | |
parent | 8ad9329e0d77adcf821ae085f40201227443f980 (diff) |
tracking: Convert all outgoing unicode objects to str.
-rw-r--r-- | modules/tracking.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/tracking.py b/modules/tracking.py index 1a7b300..86b59b7 100644 --- a/modules/tracking.py +++ b/modules/tracking.py @@ -383,9 +383,13 @@ class Module: if msg: if type(msg) == list: for i in msg: - self.irc.msg(channel if not channel == self.irc.nickname else nick.split('!')[0], i.encode('utf-8')) + if isinstance(i, unicode): + i = i.encode('utf-8') + self.irc.msg(channel if not channel == self.irc.nickname else nick.split('!')[0], i) else: - self.irc.msg(channel if not channel == self.irc.nickname else nick.split('!')[0], msg.encode('utf-8')) + if isinstance(msg, unicode): + msg = msg.encode('utf-8') + self.irc.msg(channel if not channel == self.irc.nickname else nick.split('!')[0], msg) else: self.irc.msg(channel if not channel == self.irc.nickname else nick.split('!')[0], 'No data returned (this is a bug).') |