summaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorMatthias Klose <doko@ubuntu.com>2009-07-23 14:25:33 +0000
committerMatthias Klose <doko@gcc.gnu.org>2009-07-23 14:25:33 +0000
commitfa89660f9ac3de88b0dbd12403b720d8179eeca1 (patch)
tree178c970a137f6376c37bd7319cfd7ed44950b4c5 /libjava
parente27b834be08de2247b8c4813f0debfb397fa2a6f (diff)
downloadgcc-fa89660f9ac3de88b0dbd12403b720d8179eeca1.tar.gz
aotcompile.py.in: Use hashlib instead of md5 if available.
2009-07-23 Matthias Klose <doko@ubuntu.com> * contrib/aotcompile.py.in: Use hashlib instead of md5 if available. From-SVN: r150010
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog4
-rw-r--r--libjava/contrib/aotcompile.py.in8
2 files changed, 10 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index d838e26fabe..3afbd632a2b 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-23 Matthias Klose <doko@ubuntu.com>
+
+ * contrib/aotcompile.py.in: Use hashlib instead of md5 if available.
+
2009-07-17 Joseph Myers <joseph@codesourcery.com>
PR other/40784
diff --git a/libjava/contrib/aotcompile.py.in b/libjava/contrib/aotcompile.py.in
index 9db08d2b59c..17a2dd68ea8 100644
--- a/libjava/contrib/aotcompile.py.in
+++ b/libjava/contrib/aotcompile.py.in
@@ -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 @@ class Job:
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