Keep trying ports until it finds a free one

This commit is contained in:
Micah Lee 2018-09-27 21:22:10 -07:00
parent a72d315ae8
commit bdf91361b4

View File

@ -433,7 +433,7 @@ class Common(object):
tmpsock.bind(("127.0.0.1", random.randint(min_port, max_port)))
break
except OSError as e:
raise OSError(e)
pass
_, port = tmpsock.getsockname()
return port