]> granicus.if.org Git - python/commitdiff
Fix asyncore test that fails on pypy by explicitly closing file
authorMichael Foord <fuzzyman@voidspace.org.uk>
Sun, 16 Jan 2011 13:03:37 +0000 (13:03 +0000)
committerMichael Foord <fuzzyman@voidspace.org.uk>
Sun, 16 Jan 2011 13:03:37 +0000 (13:03 +0000)
Lib/test/test_asyncore.py

index 621733402994a7accef1a7e5968d1514777ea209..d5e6fa3a016b84ac797a2474c3361a3a30d79178 100644 (file)
@@ -398,7 +398,8 @@ class DispatcherWithSendTests_UsePoll(DispatcherWithSendTests):
 class FileWrapperTest(unittest.TestCase):
     def setUp(self):
         self.d = "It's not dead, it's sleeping!"
-        file(TESTFN, 'w').write(self.d)
+        with file(TESTFN, 'w') as h:
+            h.write(self.d)
 
     def tearDown(self):
         unlink(TESTFN)