fix switch_to_random_interface

This commit is contained in:
ThomasV 2014-07-29 14:26:19 +02:00
parent 411a87e0a3
commit 0240b8c924
1 changed files with 2 additions and 3 deletions

View File

@ -250,13 +250,12 @@ class Network(threading.Thread):
def switch_to_random_interface(self):
while True:
while self.interfaces:
i = random.choice(self.interfaces.values())
if i.is_connected:
self.switch_to_interface(i)
break
else:
time.sleep(0.1)
self.interfaces.pop(i.server)
def switch_to_interface(self, interface):
server = interface.server