diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py index b33995566cf..6a77d6c91f7 100644 --- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -1867,11 +1867,12 @@ def test_interleaved(self): for f in get_files(self): self.make_test_archive(f) with zipfile.ZipFile(f, mode="r") as zipf: - with zipf.open('ones') as zopen1, zipf.open('twos') as zopen2: + with zipf.open('ones') as zopen1: data1 = zopen1.read(500) - data2 = zopen2.read(500) - data1 += zopen1.read() - data2 += zopen2.read() + with zipf.open('twos') as zopen2: + data2 = zopen2.read(500) + data1 += zopen1.read() + data2 += zopen2.read() self.assertEqual(data1, self.data1) self.assertEqual(data2, self.data2)