mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Filter: Fix @unhexlify for Python 3.
This commit is contained in:
parent
cf6084e402
commit
cc56645cf9
@ -196,7 +196,8 @@ class Filter(callbacks.Plugin):
|
||||
<hexstring> must be a string of hexadecimal digits.
|
||||
"""
|
||||
try:
|
||||
irc.reply(self._hex_decoder(text.encode('utf8'))[0].decode('utf8'))
|
||||
irc.reply(self._hex_decoder(text.encode('utf8'))[0]
|
||||
.decode('utf8', 'replace'))
|
||||
except TypeError:
|
||||
irc.error(_('Invalid input.'))
|
||||
unhexlify = wrap(unhexlify, ['text'])
|
||||
|
@ -102,6 +102,7 @@ class FilterTest(ChannelPluginTestCase):
|
||||
def testHexlifyUnhexlify(self):
|
||||
for s in map(str, range(1000, 1010)):
|
||||
self.assertResponse('unhexlify [hexlify %s]' % s, s)
|
||||
self.assertNotError('unhexlify ff')
|
||||
|
||||
def testScramble(self):
|
||||
s = 'the recalcitrant jamessan tests his scramble function'
|
||||
|
Loading…
Reference in New Issue
Block a user