From: Xavier de Gaye Date: Sun, 13 Nov 2016 18:39:48 +0000 (+0100) Subject: Fix temporary file not deleted in test_socket X-Git-Tag: v3.6.0b4~93^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=547c1b9acef2d7adcb8d3540bd969d115073d953;p=thirdparty%2FPython%2Fcpython.git Fix temporary file not deleted in test_socket --- diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index cce7d5213e9f..dbfcab8f6feb 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -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)