aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2008-08-02 21:02:48 +0000
committerAntoine Pitrou <solipsis@pitrou.net>2008-08-02 21:02:48 +0000
commit2f89aa678549eae1557247a36ed9194af9a4f7b7 (patch)
treeb8de431ef79fb42ca92d8601977a8ab5ac533ca8 /Lib/test/test_socket.py
parent07431a302a3698bec8b9eb9debc9f630479141e3 (diff)
downloadcpython-2f89aa678549eae1557247a36ed9194af9a4f7b7.tar.gz
cpython-2f89aa678549eae1557247a36ed9194af9a4f7b7.zip
#2538: bytes objects can only provide read-only buffers
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 222c42ce7f4..9d753b7ea53 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -1112,7 +1112,7 @@ class BufferIOTest(SocketConnectedTest):
SocketConnectedTest.__init__(self, methodName=methodName)
def testRecvInto(self):
- buf = b" "*1024
+ buf = bytearray(1024)
nbytes = self.cli_conn.recv_into(buf)
self.assertEqual(nbytes, len(MSG))
msg = buf[:len(MSG)]
@@ -1123,7 +1123,7 @@ class BufferIOTest(SocketConnectedTest):
self.serv_conn.send(buf)
def testRecvFromInto(self):
- buf = b" "*1024
+ buf = bytearray(1024)
nbytes, addr = self.cli_conn.recvfrom_into(buf)
self.assertEqual(nbytes, len(MSG))
msg = buf[:len(MSG)]