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]