mirror of
https://github.com/sivel/speedtest-cli.git
synced 2026-10-22 11:03:29 +02:00
Support for Python 2.4:
- Use md5.md5 when hashlib.md5 is not available
This commit is contained in:
+5
-2
@@ -25,7 +25,10 @@ from xml.dom import minidom as DOM
|
|||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import hashlib
|
try:
|
||||||
|
from hashlib import md5
|
||||||
|
except:
|
||||||
|
from md5 import md5
|
||||||
import threading
|
import threading
|
||||||
from Queue import Queue
|
from Queue import Queue
|
||||||
|
|
||||||
@@ -280,7 +283,7 @@ def speedtest():
|
|||||||
'recommendedserverid=%s' % best['id'],
|
'recommendedserverid=%s' % best['id'],
|
||||||
'accuracy=%s' % 1,
|
'accuracy=%s' % 1,
|
||||||
'serverid=%s' % best['id'],
|
'serverid=%s' % best['id'],
|
||||||
'hash=%s' % hashlib.md5('%s-%s-%s-%s' %
|
'hash=%s' % md5('%s-%s-%s-%s' %
|
||||||
(ping, ulspeedk, dlspeedk, '297aae72')
|
(ping, ulspeedk, dlspeedk, '297aae72')
|
||||||
).hexdigest()]
|
).hexdigest()]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user