]> granicus.if.org Git - python/commitdiff
Fix resource warning in test_file. Patch by Brian Brazil.
authorAntoine Pitrou <solipsis@pitrou.net>
Sat, 30 Oct 2010 14:22:43 +0000 (14:22 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Sat, 30 Oct 2010 14:22:43 +0000 (14:22 +0000)
Lib/test/test_file.py

index ebaa38beb4390abebb95ddb2b78d49194ed7310b..c48b8d0c76281e6409adc1c77459ab473d14ecc8 100644 (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: