Fix resource warning in test_file. Patch by Brian Brazil.

This commit is contained in:
Antoine Pitrou 2010-10-30 14:22:43 +00:00
parent bfa3470b85
commit a6e9502ab9
1 changed files with 2 additions and 0 deletions

View File

@ -303,6 +303,8 @@ class OtherFileTests(unittest.TestCase):
if lines != testlines:
self.fail("readlines() after next() with empty buffer "
"failed. Got %r, expected %r" % (line, testline))
f.close()
# Reading after iteration hit EOF shouldn't hurt either
f = self.open(TESTFN, 'rb')
try: