1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
Description: This fixes the depreciated md5 module
Author: Charlie Smotherman <cjsmo@cableone.net>
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591488
Last-Update: 2011-03-01
Index: google-sitemapgen-1.5/sitemap_gen.py
===================================================================
--- google-sitemapgen-1.5.orig/sitemap_gen.py 2011-03-01 15:06:43.000000000 -0600
+++ google-sitemapgen-1.5/sitemap_gen.py 2011-03-01 15:08:23.000000000 -0600
@@ -62,7 +62,7 @@
import fnmatch
import glob
import gzip
-import md5
+import hashlib
import os
import re
import stat
@@ -425,7 +425,7 @@
""" Output and count a warning. Suppress duplicate warnings. """
if text:
text = encoder.NarrowText(text, None)
- hash = md5.new(text).digest()
+ hash = hashlib.md5(text).digest()
if not self._warns_shown.has_key(hash):
self._warns_shown[hash] = 1
print '[WARNING] ' + text
@@ -438,7 +438,7 @@
""" Output and count an error. Suppress duplicate errors. """
if text:
text = encoder.NarrowText(text, None)
- hash = md5.new(text).digest()
+ hash = hashlib.md5(text).digest()
if not self._errors_shown.has_key(hash):
self._errors_shown[hash] = 1
print '[ERROR] ' + text
@@ -648,8 +648,8 @@
if not self.loc:
return None
if self.loc.endswith('/'):
- return md5.new(self.loc[:-1]).digest()
- return md5.new(self.loc).digest()
+ return hashlib.md5(self.loc[:-1]).digest()
+ return hashlib.md5(self.loc).digest()
#end def MakeHash
def Log(self, prefix='URL', level=3):
|