Issue #5334: array.fromfile() failed to insert values when EOFError was raised.

Reviewed by Benjamin Peterson.
This commit is contained in:
Hirokazu Yamamoto 2009-03-06 03:04:07 +00:00
parent 3aed8d5110
commit 54d0df69c0
3 changed files with 14 additions and 8 deletions

View file

@ -174,9 +174,8 @@ class BaseTest(unittest.TestCase):
b.fromfile(f, len(self.example))
self.assertEqual(b, array.array(self.typecode, self.example))
self.assertNotEqual(a, b)
b.fromfile(f, len(self.example))
self.assertRaises(EOFError, b.fromfile, f, len(self.example)+1)
self.assertEqual(a, b)
self.assertRaises(EOFError, b.fromfile, f, 1)
f.close()
finally:
if not f.closed: