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. --- bin/update | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'bin/update') diff --git a/bin/update b/bin/update index 2a25da01..e36c1c40 100755 --- a/bin/update +++ b/bin/update @@ -34,7 +34,6 @@ some previous version. It knows about versions back to 1.0b4 (?). """ import os -import md5 import sys import time import errno @@ -131,7 +130,7 @@ def move_language_templates(mlist): # No global template continue - gcksum = md5.new(fp.read()).digest() + gcksum = Utils.md5_new(fp.read()).digest() fp.close() # Match against the lists//* template try: @@ -139,7 +138,7 @@ def move_language_templates(mlist): except IOError, e: if e.errno <> errno.ENOENT: raise else: - tcksum = md5.new(fp.read()).digest() + tcksum = Utils.md5_new(fp.read()).digest() fp.close() if gcksum == tcksum: os.unlink(os.path.join(mlist.fullpath(), gtemplate)) @@ -149,7 +148,7 @@ def move_language_templates(mlist): except IOError, e: if e.errno <> errno.ENOENT: raise else: - tcksum = md5.new(fp.read()).digest() + tcksum = Utils.md5_new(fp.read()).digest() fp.close() if gcksum == tcksum: os.unlink(os.path.join(mlist.fullpath(), gtemplate + '.prev')) @@ -159,7 +158,7 @@ def move_language_templates(mlist): except IOError, e: if e.errno <> errno.ENOENT: raise else: - tcksum = md5.new(fp.read()).digest() + tcksum = Utils.md5_new(fp.read()).digest() fp.close() if gcksum == tcksum: os.unlink(os.path.join(mlist.fullpath(), 'en', gtemplate)) @@ -169,7 +168,7 @@ def move_language_templates(mlist): except IOError, e: if e.errno <> errno.ENOENT: raise else: - tcksum = md5.new(fp.read()).digest() + tcksum = Utils.md5_new(fp.read()).digest() fp.close() if gcksum == tcksum: os.unlink(os.path.join(mm_cfg.TEMPLATE_DIR, gtemplate)) @@ -179,7 +178,7 @@ def move_language_templates(mlist): except IOError, e: if e.errno <> errno.ENOENT: raise else: - tcksum = md5.new(fp.read()).digest() + tcksum = Utils.md5_new(fp.read()).digest() fp.close() if gcksum == tcksum: os.unlink(os.path.join(mm_cfg.TEMPLATE_DIR, -- cgit v1.2.3