]> granicus.if.org Git - python/commitdiff
Issue #11022 and #15287: correctly remove the TESTFN file in test_builtin.
authorFlorent Xicluna <florent.xicluna@gmail.com>
Sun, 8 Jul 2012 10:08:45 +0000 (12:08 +0200)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Sun, 8 Jul 2012 10:08:45 +0000 (12:08 +0200)
Lib/test/test_builtin.py

index d0d17c76dfd9dc78b6994f492188d6ab160154c8..c32992cc898ef7c8abe840d640f15da09c60d5e1 100644 (file)
@@ -960,7 +960,7 @@ class BuiltinTest(unittest.TestCase):
             self.assertEqual(fp.read(1000), 'YYY'*100)
         finally:
             fp.close()
-        unlink(TESTFN)
+            unlink(TESTFN)
 
     def test_open_default_encoding(self):
         old_environ = dict(os.environ)
@@ -979,6 +979,7 @@ class BuiltinTest(unittest.TestCase):
                 self.assertEqual(fp.encoding, current_locale_encoding)
             finally:
                 fp.close()
+                unlink(TESTFN)
         finally:
             os.environ.clear()
             os.environ.update(old_environ)