Print error message we get from socket.connect_ex when it fails

This commit is contained in:
rl1987 2018-12-03 14:49:33 +02:00
parent 25f3b82445
commit db9ab3754a

View File

@ -19,9 +19,10 @@ def fail(msg):
def try_connecting_to_socksport():
socks_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
if socks_socket.connect_ex(('127.0.0.1', socks_port)):
e = socks_socket.connect_ex(('127.0.0.1', socks_port))
if e:
tor_process.terminate()
fail('Cannot connect to SOCKSPort')
fail('Cannot connect to SOCKSPort: error ' + os.strerror(e))
socks_socket.close()
def wait_for_log(s):