Don't run callback if a callback is not set
This commit is contained in:
parent
395553f089
commit
557e662a6c
|
@ -784,6 +784,7 @@ class Speedtest(object):
|
||||||
while thread.isAlive():
|
while thread.isAlive():
|
||||||
thread.join(timeout=0.1)
|
thread.join(timeout=0.1)
|
||||||
finished.append(sum(thread.result))
|
finished.append(sum(thread.result))
|
||||||
|
if callback:
|
||||||
callback(thread.i, url_count, end=True)
|
callback(thread.i, url_count, end=True)
|
||||||
del thread
|
del thread
|
||||||
|
|
||||||
|
@ -834,6 +835,7 @@ class Speedtest(object):
|
||||||
while thread.isAlive():
|
while thread.isAlive():
|
||||||
thread.join(timeout=0.1)
|
thread.join(timeout=0.1)
|
||||||
finished.append(thread.result)
|
finished.append(thread.result)
|
||||||
|
if callback:
|
||||||
callback(thread.i, size_count, end=True)
|
callback(thread.i, size_count, end=True)
|
||||||
del thread
|
del thread
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue