Support for Python 2.4:
- Use md5.md5 when hashlib.md5 is not available
This commit is contained in:
parent
76cd7d238f
commit
f3bdb7257c
|
@ -25,7 +25,10 @@ from xml.dom import minidom as DOM
|
|||
import time
|
||||
import os
|
||||
import sys
|
||||
import hashlib
|
||||
try:
|
||||
from hashlib import md5
|
||||
except:
|
||||
from md5 import md5
|
||||
import threading
|
||||
from Queue import Queue
|
||||
|
||||
|
@ -280,9 +283,9 @@ def speedtest():
|
|||
'recommendedserverid=%s' % best['id'],
|
||||
'accuracy=%s' % 1,
|
||||
'serverid=%s' % best['id'],
|
||||
'hash=%s' % hashlib.md5('%s-%s-%s-%s' %
|
||||
(ping, ulspeedk, dlspeedk, '297aae72')
|
||||
).hexdigest()]
|
||||
'hash=%s' % md5('%s-%s-%s-%s' %
|
||||
(ping, ulspeedk, dlspeedk, '297aae72')
|
||||
).hexdigest()]
|
||||
|
||||
req = urllib2.Request('http://www.speedtest.net/api/api.php',
|
||||
data='&'.join(apiData))
|
||||
|
|
Loading…
Reference in New Issue