From 97b68126f271f9bed7e90ab54446054e5c86ced5 Mon Sep 17 00:00:00 2001 From: Michael Foord Date: Sun, 16 Jan 2011 13:03:37 +0000 Subject: [PATCH] Fix asyncore test that fails on pypy by explicitly closing file --- Lib/test/test_asyncore.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py index 62173340299..d5e6fa3a016 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)