[tor-commits] [ooni-probe/master] Skip the outer loop also on empty measurements

art at torproject.org art at torproject.org
Fri Oct 14 19:00:56 UTC 2016


commit ffab2ef266e3facfd0d9a9c5120cda2b8c3a811b
Author: Arturo Filastò <arturo at filasto.net>
Date:   Wed Oct 12 16:45:03 2016 +0200

    Skip the outer loop also on empty measurements
---
 ooni/nettest.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ooni/nettest.py b/ooni/nettest.py
index 7a2afc8..1bb5678 100644
--- a/ooni/nettest.py
+++ b/ooni/nettest.py
@@ -608,6 +608,11 @@ class NetTest(object):
                     self.state.taskCreated()
                     yield measurement
 
+                # This is to skip setting callbacks on measurements that
+                # cannot be run.
+                if len(measurements) == 0:
+                    continue
+
                 # When the measurement.done callbacks have all fired
                 # call the postProcessor before writing the report
                 if self.report:





More information about the tor-commits mailing list