Revision: 5968 Author: russblau Date: 2008-10-14 19:22:40 +0000 (Tue, 14 Oct 2008)
Log Message: ----------- Hush DeprecationWarning for Py 2.6 users
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2008-10-14 19:14:57 UTC (rev 5967) +++ trunk/pywikipedia/wikipedia.py 2008-10-14 19:22:40 UTC (rev 5968) @@ -119,7 +119,11 @@ import traceback import time, threading, Queue import math -import re, md5, codecs, difflib, locale +import re, codecs, difflib, locale +try: + from hashlib import md5 +except ImportError: # Python 2.4 compatibility + from md5 import new as md5 import xml.sax, xml.sax.handler import htmlentitydefs import warnings @@ -2678,7 +2682,7 @@ """Return image file's MD5 checksum.""" uo = MyURLopener() f = uo.open(self.fileUrl()) - md5Checksum = md5.new(f.read()).hexdigest() + md5Checksum = md5(f.read()).hexdigest() return md5Checksum
def getFileVersionHistory(self):
pywikipedia-l@lists.wikimedia.org