From 44bc5d2bef5e6aa202fcbfb241a1bb7b5f95b81f Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 29 Apr 2014 19:21:55 -0500 Subject: [PATCH] Additionally, don't run callback if the shutdown_event is set --- speedtest_cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/speedtest_cli.py b/speedtest_cli.py index d6e2bce..6688711 100755 --- a/speedtest_cli.py +++ b/speedtest_cli.py @@ -784,7 +784,7 @@ class Speedtest(object): while thread.isAlive(): thread.join(timeout=0.1) finished.append(sum(thread.result)) - if callback: + if not shutdown_event.isSet() and callback: callback(thread.i, url_count, end=True) del thread @@ -835,7 +835,7 @@ class Speedtest(object): while thread.isAlive(): thread.join(timeout=0.1) finished.append(thread.result) - if callback: + if not shutdown_event.isSet() and callback: callback(thread.i, size_count, end=True) del thread