mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
String: Return raw bytes when decode returns binary data.
This commit is contained in:
parent
bcd39743f0
commit
981476d6d5
@ -143,7 +143,10 @@ class String(callbacks.Plugin):
|
||||
if sys.version_info[0] < 3 and isinstance(text, unicode):
|
||||
text = text.encode('utf-8')
|
||||
elif sys.version_info[0] >= 3 and isinstance(text, bytes):
|
||||
try:
|
||||
text = text.decode()
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
|
||||
# Reply
|
||||
irc.reply(text)
|
||||
|
Loading…
Reference in New Issue
Block a user