[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit a00625b036dbff58d2038deea91782e0ba664549
Author: juga0 <juga@xxxxxxxxxx>
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):



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits