[Python-checkins] bpo-42349: Switch to test.support.unlink per review by Serhiy Storchaka (GH-8529)

Tim Golden webhook-mailer at python.org
Sat Jul 28 13:27:14 EDT 2018


https://github.com/python/cpython/commit/1561703a78849ac3511055590d9d1bd2c62a2072
commit: 1561703a78849ac3511055590d9d1bd2c62a2072
branch: master
author: Tim Golden <mail at timgolden.me.uk>
committer: GitHub <noreply at github.com>
date: 2018-07-28T18:27:11+01:00
summary:

bpo-42349: Switch to test.support.unlink per review by Serhiy Storchaka (GH-8529)

Serhiy Storchaka pointed out that using test.support.unlink was preferable

files:
M Lib/test/test_bz2.py

diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py
index e62729a5a2f8..f158b901b9c9 100644
--- a/Lib/test/test_bz2.py
+++ b/Lib/test/test_bz2.py
@@ -81,10 +81,7 @@ def setUp(self):
         os.close(fd)
 
     def tearDown(self):
-        try:
-            os.unlink(self.filename)
-        except FileNotFoundError:
-            pass
+        unlink(self.filename)
 
 
 class BZ2FileTest(BaseTest):



More information about the Python-checkins mailing list