In stdlib, use hashlib instead of deprecated md5 and sha modules.

This commit is contained in:
Georg Brandl 2006-04-30 08:57:35 +00:00
parent fa42bd7af4
commit bffb0bc064
6 changed files with 16 additions and 17 deletions

View file

@ -295,8 +295,8 @@ class POP3:
m = self.timestamp.match(self.welcome)
if not m:
raise error_proto('-ERR APOP not supported by server')
import md5
digest = md5.new(m.group(1)+secret).digest()
import hashlib
digest = hashlib.md5(m.group(1)+secret).digest()
digest = ''.join(map(lambda x:'%02x'%ord(x), digest))
return self._shortcmd('APOP %s %s' % (user, digest))