Author: esr
Date: Fri May 15 04:29:34 2009
New Revision: 35632
URL: http://svn.gna.org/viewcvs/wesnoth?rev=35632&view=rev
Log:
Make python tools use hashlib instead of the deprecated md5 module.
Modified:
trunk/data/tools/wesnoth/wmltools.py
trunk/data/tools/wmlscope
Modified: trunk/data/tools/wesnoth/wmltools.py
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wesnoth/wmltools.py?rev=35632&r1=35631&r2=35632&view=diff
==============================================================================
--- trunk/data/tools/wesnoth/wmltools.py (original)
+++ trunk/data/tools/wesnoth/wmltools.py Fri May 15 04:29:34 2009
@@ -3,7 +3,7 @@
"""
-import sys, os, re, sre_constants, md5, glob, gzip
+import sys, os, re, sre_constants, hashlib, glob, gzip
resource_extensions = ("png", "jpg", "jpeg", "ogg", "wav", "map", "mask")
image_reference = r"[A-Za-z0-9{}.][A-Za-z0-9_/+{}.-]*\.(png|jpg)(?=(~.*)?)"
@@ -403,7 +403,7 @@
else:
name = tokens[1]
here = Reference(namespace, filename, n+1, line,
args=tokens[2:])
- here.hash = md5.new()
+ here.hash = hashlib.md5()
here.docstring = line.lstrip()[8:] # Strip off
#define_
state = "macro_header"
continue
Modified: trunk/data/tools/wmlscope
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmlscope?rev=35632&r1=35631&r2=35632&view=diff
==============================================================================
--- trunk/data/tools/wmlscope (original)
+++ trunk/data/tools/wmlscope Fri May 15 04:29:34 2009
@@ -91,7 +91,7 @@
#
# sets the warning level.
-import sys, os, time, re, getopt, md5
+import sys, os, time, re, getopt, hashlib
from wesnoth.wmltools import *
def interpret(lines, css):
@@ -438,7 +438,7 @@
collisions = []
for (namespace, filename) in xref.filelist.generator():
ifp = open(filename)
- collisions.append(md5.new(ifp.read()).digest())
+ collisions.append(hashlib.md5(ifp.read()).digest())
ifp.close()
collisions = zip(xref.filelist.flatten(), collisions)
hashcounts = {}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits