mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
#2538: bytes objects can only provide read-only buffers
This commit is contained in:
parent
07431a302a
commit
2f89aa6785
4 changed files with 13 additions and 8 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue