]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix temporary file not deleted in test_socket
authorXavier de Gaye <xdegaye@users.sourceforge.net>
Sun, 13 Nov 2016 18:39:48 +0000 (19:39 +0100)
committerXavier de Gaye <xdegaye@users.sourceforge.net>
Sun, 13 Nov 2016 18:39:48 +0000 (19:39 +0100)
Lib/test/test_socket.py

index cce7d5213e9f7bad3b9a974c214107117340f346..dbfcab8f6febb56125e07f904bba33bb2d294594 100644 (file)
@@ -1442,7 +1442,8 @@ class GeneralModuleTests(unittest.TestCase):
         # type and populates the socket object.
         #
         # On Windows this trick won't work, so the test is skipped.
-        fd, _ = tempfile.mkstemp()
+        fd, path = tempfile.mkstemp()
+        self.addCleanup(os.unlink, path)
         with socket.socket(family=42424, type=13331, fileno=fd) as s:
             self.assertEqual(s.family, 42424)
             self.assertEqual(s.type, 13331)