From: Matthias Klose <doko@ubuntu.com>
To: GCJ-patches <java-patches@gcc.gnu.org>
Subject: Fwd: [patch] use hashlib instead of the deprecated md5 module
Date: Thu, 23 Jul 2009 14:03:00 -0000 [thread overview]
Message-ID: <4A686D88.2060305@ubuntu.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 425 bytes --]
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 <doko@ubuntu.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
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
[-- Attachment #2: md5.diff --]
[-- Type: text/plain, Size: 861 bytes --]
2009-07-23 Matthias Klose <doko@ubuntu.com>
* 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
next reply other threads:[~2009-07-23 14:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-23 14:03 Matthias Klose [this message]
2009-07-23 14:37 ` Andrew Haley
2009-07-23 14:38 ` Andrew Haley
2009-07-23 14:48 ` Matthias Klose
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A686D88.2060305@ubuntu.com \
--to=doko@ubuntu.com \
--cc=java-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).