From: Antoine Pitrou Date: Sat, 30 Oct 2010 14:22:43 +0000 (+0000) Subject: Fix resource warning in test_file. Patch by Brian Brazil. X-Git-Tag: v3.2a4~258 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a6e9502ab9cdc35343bfa86e3676e7801ac733cb;p=python Fix resource warning in test_file. Patch by Brian Brazil. --- diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index ebaa38beb4..c48b8d0c76 100644 --- a/Lib/test/test_file.py +++ b/Lib/test/test_file.py @@ -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: