From: Michael Foord Date: Sun, 16 Jan 2011 13:03:37 +0000 (+0000) Subject: Fix asyncore test that fails on pypy by explicitly closing file X-Git-Tag: v2.7.2rc1~363 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97b68126f271f9bed7e90ab54446054e5c86ced5;p=python Fix asyncore test that fails on pypy by explicitly closing file --- diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py index 6217334029..d5e6fa3a01 100644 --- a/Lib/test/test_asyncore.py +++ b/Lib/test/test_asyncore.py @@ -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)