fix the socketserver demo code for py3k

#4275 Thanks to Don MacMillen
This commit is contained in:
Benjamin Peterson 2008-11-08 17:24:34 +00:00
parent ef6a19e3ea
commit 06fd5f8cc8
5 changed files with 38 additions and 30 deletions

View file

@ -56,7 +56,8 @@ def client():
line = sys.stdin.readline()
if not line:
break
s.sendto(line, addr)
print('addr = ', addr)
s.sendto(bytes(line, 'ascii'), addr)
data, fromaddr = s.recvfrom(BUFSIZE)
print('client received %r from %r' % (data, fromaddr))