]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-42349: Switch to test.support.unlink per review by Serhiy Storchaka (GH-8529)
authorTim Golden <mail@timgolden.me.uk>
Sat, 28 Jul 2018 17:27:11 +0000 (18:27 +0100)
committerGitHub <noreply@github.com>
Sat, 28 Jul 2018 17:27:11 +0000 (18:27 +0100)
Serhiy Storchaka pointed out that using test.support.unlink was preferable

Lib/test/test_bz2.py

index e62729a5a2f827c1712942056bb4b96ae6fa56bb..f158b901b9c90ab675115a5aa40af2ae0d5a4d35 100644 (file)
@@ -81,10 +81,7 @@ class BaseTest(unittest.TestCase):
         os.close(fd)
 
     def tearDown(self):
-        try:
-            os.unlink(self.filename)
-        except FileNotFoundError:
-            pass
+        unlink(self.filename)
 
 
 class BZ2FileTest(BaseTest):