diff options
author | Guido van Rossum <guido@python.org> | 2007-08-03 19:03:39 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-08-03 19:03:39 +0000 |
commit | 15863ea07ab4eed2d91ce55b274245e8d420723d (patch) | |
tree | 391e94b21c17d0dbb6fde8fb39c94fd56706e04b /Lib/test/test_socketserver.py | |
parent | ad8d30092ccebad0f940fe0ed3ff25a18c25dddf (diff) | |
download | cpython-15863ea07ab4eed2d91ce55b274245e8d420723d.tar.gz cpython-15863ea07ab4eed2d91ce55b274245e8d420723d.zip |
SF patch# 1764815 by Paul Colomiets.
Fix for test_socketserver.
Use io.BytesIO instead of io.StringIO, and adjust tests.
Diffstat (limited to 'Lib/test/test_socketserver.py')
-rw-r--r-- | Lib/test/test_socketserver.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py index da936a4780d..6682d7165bd 100644 --- a/Lib/test/test_socketserver.py +++ b/Lib/test/test_socketserver.py @@ -38,7 +38,7 @@ class MyMixinServer: self.server_close() raise -teststring = "hello world\n" +teststring = b"hello world\n" def receive(sock, n, timeout=20): r, w, x = select.select([sock], [], [], timeout) @@ -51,7 +51,7 @@ def testdgram(proto, addr): s = socket.socket(proto, socket.SOCK_DGRAM) s.sendto(teststring, addr) buf = data = receive(s, 100) - while data and '\n' not in buf: + while data and b'\n' not in buf: data = receive(s, 100) buf += data verify(buf == teststring) @@ -62,7 +62,7 @@ def teststream(proto, addr): s.connect(addr) s.sendall(teststring) buf = data = receive(s, 100) - while data and '\n' not in buf: + while data and b'\n' not in buf: data = receive(s, 100) buf += data verify(buf == teststring) |