diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/hostchooser.py | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/common/hostchooser.py b/common/hostchooser.py index 7dea833..bbb0eb6 100644 --- a/common/hostchooser.py +++ b/common/hostchooser.py @@ -32,7 +32,7 @@ def answer_ping(s, descr, addr, extra='', httpport=''):          print("ping by", source, file=sys.stderr)          answer = '%s:%s:%s:%s:%s:%s' % (PONG_MESSAGE, descr,                                          addr[0], addr[1], extra, httpport) -        s.sendto(answer, source) +        s.sendto(answer.encode(), source)      else:          print("unexpected data on UDP port %d by" % UDP_PORT, source, file=sys.stderr) @@ -116,7 +116,7 @@ def find_servers(hostlist=[('127.0.0.1', None), ('<broadcast>', None)],              else:                  hostsend, hostrecv = events.setdefault(ipaddr, ([], []))                  hostrecv.append(time.time()) -            data = data.split(':') +            data = data.split(b':')              if len(data) >= 4 and data[0] == PONG_MESSAGE:                  try:                      port = int(data[3])  | 
