summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xml2po/ChangeLog6
-rw-r--r--xml2po/modes/docbook.py8
2 files changed, 12 insertions, 2 deletions
diff --git a/xml2po/ChangeLog b/xml2po/ChangeLog
index f46a73f..2b08d74 100644
--- a/xml2po/ChangeLog
+++ b/xml2po/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-02 Claude Paroz <claude@2xlibre.net>
+
+ * modes/docbook.py: Use new hashlib module rather than deprecated md5
+ module, when available.
+ Fixes bug #576161.
+
2008-07-14 Danilo Šegan <danilo@gnome.org>
* xml2po.py: Apply Goran Rakić's patch for #437371.
diff --git a/xml2po/modes/docbook.py b/xml2po/modes/docbook.py
index ceec906..7fac01b 100644
--- a/xml2po/modes/docbook.py
+++ b/xml2po/modes/docbook.py
@@ -36,8 +36,12 @@
import re
import libxml2
import os
-import md5
import sys
+try:
+ # Hashlib is new in Python 2.5
+ from hashlib import md5 as md5_new
+except ImportError:
+ from md5 import new as md5_new
class docbookXmlMode:
"""Class for special handling of DocBook document types.
@@ -109,7 +113,7 @@ class docbookXmlMode:
return last
def _md5_for_file(self, filename):
- hash = md5.new()
+ hash = md5_new()
input = open(filename, "rb")
read = input.read(4096)
while read: