diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-10-02 11:40:30 +0300 |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-10-02 11:40:30 +0300 |
commit | a5749197aaecefef522c13544471a9cb571ab5b6 (patch) | |
tree | 0fc0a3e716d4b20dd72f66829d755d22f5984db3 | |
parent | d3bdec16aba9e22e5fa77716ce173c8588cb11fa (diff) | |
parent | d261cb62296586ab4aaaed7e5ebb7542135d9c15 (diff) | |
download | cpython-git-a5749197aaecefef522c13544471a9cb571ab5b6.tar.gz |
Issue #20254: Merge from 3.6
-rw-r--r-- | Lib/test/test_socket.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 41c206b6ea..c9add6cc98 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -4668,9 +4668,10 @@ class BufferIOTest(SocketConnectedTest): SocketConnectedTest.__init__(self, methodName=methodName) def testRecvIntoArray(self): - buf = bytearray(1024) + buf = array.array("B", [0] * len(MSG)) nbytes = self.cli_conn.recv_into(buf) self.assertEqual(nbytes, len(MSG)) + buf = buf.tobytes() msg = buf[:len(MSG)] self.assertEqual(msg, MSG) @@ -4697,9 +4698,10 @@ class BufferIOTest(SocketConnectedTest): _testRecvIntoMemoryview = _testRecvIntoArray def testRecvFromIntoArray(self): - buf = bytearray(1024) + buf = array.array("B", [0] * len(MSG)) nbytes, addr = self.cli_conn.recvfrom_into(buf) self.assertEqual(nbytes, len(MSG)) + buf = buf.tobytes() msg = buf[:len(MSG)] self.assertEqual(msg, MSG) |