Fix test__socket failure on Linux
@@ -181,7 +181,7 @@ OTHER_GLOBALS = {"AI_ADDRCONFIG" : 32,
"TCP_WINDOW_CLAMP" : 10}
def find_free_port():
- s = socket.socket()
+ with socket.socket() as s:
s.bind(('', 0))
return s.getsockname()[1]
