Skip to content

Commit 060a670

Browse files
committed
Remove bufs, zip from test, just make a local bytearray
1 parent 06e98e8 commit 060a670

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Lib/test/_test_eintr.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ def test_readinto(self):
160160
# the payload below are smaller than PIPE_BUF, hence the writes will be
161161
# atomic
162162
datas = [b"hello", b"world", b"spam"]
163-
bufs = [bytearray(5), bytearray(5), bytearray(4)]
164163

165164
code = '\n'.join((
166165
'import os, sys, time',
@@ -178,9 +177,10 @@ def test_readinto(self):
178177
proc = self.subprocess(code, str(wr), pass_fds=[wr])
179178
with kill_on_error(proc):
180179
os.close(wr)
181-
for data, buffer in zip(datas, bufs):
182-
os.readinto(rd, buffer)
183-
self.assertEqual(data, buffer)
180+
for data in datas:
181+
buffer = bytearray(len(data))
182+
self.assertEqual(os.readinto(rd, buffer), len(data))
183+
self.assertEqual(buffer, data)
184184
self.assertEqual(proc.wait(), 0)
185185

186186
def test_write(self):

0 commit comments

Comments
 (0)