mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Fix 'dictionary changed size during iteration'.
This commit is contained in:
parent
cb6139e110
commit
3935152d65
@ -228,7 +228,7 @@ class String(callbacks.Plugin):
|
||||
http://www.rsasecurity.com/rsalabs/faq/3-6-6.html for more information
|
||||
about md5.
|
||||
"""
|
||||
irc.reply(utils.crypt.md5(text).hexdigest())
|
||||
irc.reply(utils.crypt.md5(text.encode('utf8')).hexdigest())
|
||||
md5 = wrap(md5, ['text'])
|
||||
|
||||
@internationalizeDocstring
|
||||
|
@ -98,6 +98,10 @@ class StringTestCase(PluginTestCase):
|
||||
i = ord(c)
|
||||
self.assertResponse('ord %s' % utils.str.dqrepr(c), str(i))
|
||||
|
||||
def testMd5(self):
|
||||
self.assertResponse('md5 supybot', '630f4afcfb53c9e84c0a95064bd6add3')
|
||||
|
||||
|
||||
def testEncodeDecode(self):
|
||||
# This no longer works correctly. It almost seems like were throwing
|
||||
# in a repr() somewhere.
|
||||
|
@ -60,7 +60,8 @@ def loadPluginModule(name, ignoreDeprecation=False):
|
||||
module = imp.load_module(name, *moduleInfo)
|
||||
except:
|
||||
sys.modules.pop(name, None)
|
||||
for key in sys.modules:
|
||||
keys = sys.modules.keys()
|
||||
for key in keys:
|
||||
if key.startswith(name + '.'):
|
||||
sys.modules.pop(key)
|
||||
raise
|
||||
|
Loading…
Reference in New Issue
Block a user