From a86be44b08fe0935fe77d90948b9baad85af3624 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 12 Nov 2008 23:02:29 -0500 Subject: Apply Heiko Rommel's patch for hashlib deprecation warnings for bug 293178. I've modified the patch to improve some of the stylistic issues. --- Mailman/Queue/Switchboard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Mailman/Queue/Switchboard.py') diff --git a/Mailman/Queue/Switchboard.py b/Mailman/Queue/Switchboard.py index 94b8efa0..bd1cd357 100644 --- a/Mailman/Queue/Switchboard.py +++ b/Mailman/Queue/Switchboard.py @@ -35,7 +35,6 @@ # needs. import os -import sha import time import email import errno @@ -46,6 +45,7 @@ from Mailman import mm_cfg from Mailman import Utils from Mailman import Message from Mailman.Logging.Syslog import syslog +from Mailman.Utils import sha_new # 20 bytes of all bits set, maximum sha.digest() value shamax = 0xffffffffffffffffffffffffffffffffffffffffL @@ -118,7 +118,7 @@ class Switchboard: # this system) and the sha hex digest. #rcvtime = data.setdefault('received_time', now) rcvtime = data.setdefault('received_time', now) - filebase = `rcvtime` + '+' + sha.new(hashfood).hexdigest() + filebase = `rcvtime` + '+' + sha_new(hashfood).hexdigest() filename = os.path.join(self.__whichq, filebase + '.pck') tmpfile = filename + '.tmp' # Always add the metadata schema version number -- cgit v1.2.3