Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 547c1b9

Browse files
author
Xavier de Gaye
committed
Fix temporary file not deleted in test_socket
1 parent 7ae4112 commit 547c1b9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/test/test_socket.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,8 @@ def test_uknown_socket_family_repr(self):
14421442
# type and populates the socket object.
14431443
#
14441444
# On Windows this trick won't work, so the test is skipped.
1445-
fd, _ = tempfile.mkstemp()
1445+
fd, path = tempfile.mkstemp()
1446+
self.addCleanup(os.unlink, path)
14461447
with socket.socket(family=42424, type=13331, fileno=fd) as s:
14471448
self.assertEqual(s.family, 42424)
14481449
self.assertEqual(s.type, 13331)

0 commit comments

Comments
 (0)