From 8f9c510b5c6aeb1eb8126d710edc2b6a054e9b26 Mon Sep 17 00:00:00 2001 From: Stefan Krulj Date: Sat, 8 Dec 2012 22:16:17 +0100 Subject: [PATCH] util blocking bug test :/ --- sys/util.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/util.py b/sys/util.py index 8e1c519..afc741d 100644 --- a/sys/util.py +++ b/sys/util.py @@ -3,7 +3,6 @@ import select import socket import threading import random -import config from Queue import Queue, Empty MAGIC_PACKET = "" @@ -76,9 +75,9 @@ def get_local_ip(): while waiting: s2.sendto(bytes(MAGIC_PACKET), ('', 8888)) try: - address = queue.get(False) + address = queue.get_nowait() except Empty: - address = [config.IP] - finally: + pass + else: waiting = False return address[0]