[tor-commits] [sbws/master] Check that there are exits

pastly at torproject.org pastly at torproject.org
Wed Jul 11 15:05:40 UTC 2018


commit a00625b036dbff58d2038deea91782e0ba664549
Author: juga0 <juga at riseup.net>
Date:   Mon Jun 25 10:55:53 2018 +0000

    Check that there are exits
    
    to perform usability tests. This will avoid raising IndexError
    when choosing an exit.
---
 sbws/lib/destination.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sbws/lib/destination.py b/sbws/lib/destination.py
index 84dc580..ed1bc9b 100644
--- a/sbws/lib/destination.py
+++ b/sbws/lib/destination.py
@@ -186,6 +186,9 @@ class DestinationList:
             possible_exits = sorted(
                 possible_exits, key=lambda e: e.bandwidth, reverse=True)
             exits = possible_exits[0:num_keep]
+            if len(exits) < 1:
+                log.warning("There are no exits to perform usability tests.")
+                continue
             # Try three times to build a circuit to test this destination
             circ_id = None
             for _ in range(0, 3):





More information about the tor-commits mailing list