mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 12:42:34 +01:00
src/test.py: Encode strings only if they are not already using unicode.
This commit is contained in:
parent
48b4fc5159
commit
e3e2b23215
@ -422,7 +422,7 @@ class ChannelPluginTestCase(PluginTestCase):
|
|||||||
prefixChars = conf.supybot.reply.whenAddressedBy.chars()
|
prefixChars = conf.supybot.reply.whenAddressedBy.chars()
|
||||||
if query[0] not in prefixChars and usePrefixChar:
|
if query[0] not in prefixChars and usePrefixChar:
|
||||||
query = prefixChars[0] + query
|
query = prefixChars[0] + query
|
||||||
if sys.version_info[0] < 3:
|
if sys.version_info[0] < 3 and isinstance(query, unicode):
|
||||||
query = query.encode('utf8', errors='replace') # unicode->str
|
query = query.encode('utf8', errors='replace') # unicode->str
|
||||||
msg = ircmsgs.privmsg(to, query, prefix=frm)
|
msg = ircmsgs.privmsg(to, query, prefix=frm)
|
||||||
if self.myVerbose:
|
if self.myVerbose:
|
||||||
|
Loading…
Reference in New Issue
Block a user