diff options
Diffstat (limited to 'Lib/test/test_bufio.py')
-rw-r--r-- | Lib/test/test_bufio.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/test/test_bufio.py b/Lib/test/test_bufio.py index 84d772e..804a401 100644 --- a/Lib/test/test_bufio.py +++ b/Lib/test/test_bufio.py @@ -13,6 +13,9 @@ class BufferSizeTest(unittest.TestCase): # Write s + "\n" + s to file, then open it and ensure that successive # .readline()s deliver what we wrote. + # Ensure we can open TESTFN for writing. + test_support.unlink(test_support.TESTFN) + # Since C doesn't guarantee we can write/read arbitrary bytes in text # files, use binary mode. f = open(test_support.TESTFN, "wb") @@ -31,11 +34,7 @@ class BufferSizeTest(unittest.TestCase): self.assert_(not line) # Must be at EOF f.close() finally: - try: - import os - os.unlink(test_support.TESTFN) - except: - pass + test_support.unlink(test_support.TESTFN) def drive_one(self, pattern): for length in lengths: |