From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1260 invoked by alias); 23 Jul 2009 14:03:05 -0000 Received: (qmail 1133 invoked by uid 22791); 23 Jul 2009 14:03:04 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_84,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from adelie.canonical.com (HELO adelie.canonical.com) (91.189.90.139) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Jul 2009 14:02:57 +0000 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1MTysp-0006hR-Je for ; Thu, 23 Jul 2009 15:02:55 +0100 Received: from [194.224.98.149] (helo=[10.0.0.69]) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1MTysp-0000gN-4f for java-patches@gcc.gnu.org; Thu, 23 Jul 2009 15:02:55 +0100 Message-ID: <4A686D88.2060305@ubuntu.com> Date: Thu, 23 Jul 2009 14:03:00 -0000 From: Matthias Klose User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.1pre) Gecko/20090715 Shredder/3.0b3pre MIME-Version: 1.0 To: GCJ-patches Subject: Fwd: [patch] use hashlib instead of the deprecated md5 module Content-Type: multipart/mixed; boundary="------------050206070704010901090003" X-IsSubscribed: yes Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2009-q3/txt/msg00050.txt.bz2 This is a multi-part message in MIME format. --------------050206070704010901090003 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 425 should have sent this to java-patches in the first place ... -------- Original Message -------- Subject: [patch] use hashlib instead of the deprecated md5 module Date: Thu, 23 Jul 2009 09:53:50 -0400 From: Matthias Klose To: GCC Patches use hashlib (if available) instead of the md5 module, which was deprecated in python2.5. Ok for the trunk and the 4.4 branch? Matthias --------------050206070704010901090003 Content-Type: text/plain; name="md5.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="md5.diff" Content-length: 861 2009-07-23 Matthias Klose * contrib/aotcompile.py.in: Use hashlib instead of md5 if available. Index: contrib/aotcompile.py.in =================================================================== --- contrib/aotcompile.py.in (revision 149997) +++ contrib/aotcompile.py.in (working copy) @@ -15,7 +15,11 @@ import classfile import copy -import md5 +# The md5 module is deprecated in Python 2.5 +try: + from hashlib import md5 +except ImportError: + from md5 import md5 import operator import os import sys @@ -182,7 +186,7 @@ def addClass(self, bytes, name): """Subclasses call this from their __init__ method for every class they find.""" - digest = md5.new(bytes).digest() + digest = md5(bytes).digest() self.classes[digest] = bytes self.classnames[digest] = name --------------050206070704010901090003--