mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
Update test
This commit is contained in:
parent
1a43a8e1e7
commit
4de6a51545
@ -14,7 +14,13 @@ import subprocess
|
|||||||
import lzma
|
import lzma
|
||||||
|
|
||||||
def get_local_port(host):
|
def get_local_port(host):
|
||||||
with socket.socket() as fd:
|
family = socket.AF_INET
|
||||||
|
try:
|
||||||
|
socket.inet_aton(host)
|
||||||
|
except:
|
||||||
|
family = socket.AF_INET6
|
||||||
|
|
||||||
|
with socket.socket(family) as fd:
|
||||||
fd.bind((host, 0))
|
fd.bind((host, 0))
|
||||||
return fd.getsockname()[1]
|
return fd.getsockname()[1]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user