util blocking bug test :/

master
Stefan Krulj 14 years ago
parent f2de91ec9a
commit 8f9c510b5c
  1. 7
      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), ('<broadcast>', 8888))
try:
address = queue.get(False)
address = queue.get_nowait()
except Empty:
address = [config.IP]
finally:
pass
else:
waiting = False
return address[0]

Loading…
Cancel
Save