mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-20 09:29:24 +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.
|
<hexstring> must be a string of hexadecimal digits.
|
||||||
"""
|
"""
|
||||||
try:
|
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:
|
except TypeError:
|
||||||
irc.error(_('Invalid input.'))
|
irc.error(_('Invalid input.'))
|
||||||
unhexlify = wrap(unhexlify, ['text'])
|
unhexlify = wrap(unhexlify, ['text'])
|
||||||
|
@ -102,6 +102,7 @@ class FilterTest(ChannelPluginTestCase):
|
|||||||
def testHexlifyUnhexlify(self):
|
def testHexlifyUnhexlify(self):
|
||||||
for s in map(str, range(1000, 1010)):
|
for s in map(str, range(1000, 1010)):
|
||||||
self.assertResponse('unhexlify [hexlify %s]' % s, s)
|
self.assertResponse('unhexlify [hexlify %s]' % s, s)
|
||||||
|
self.assertNotError('unhexlify ff')
|
||||||
|
|
||||||
def testScramble(self):
|
def testScramble(self):
|
||||||
s = 'the recalcitrant jamessan tests his scramble function'
|
s = 'the recalcitrant jamessan tests his scramble function'
|
||||||
|
Loading…
Reference in New Issue
Block a user