diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2018-12-03 14:49:33 +0200 |
---|---|---|
committer | rl1987 <rl1987@sdf.lonestar.org> | 2018-12-03 14:49:33 +0200 |
commit | db9ab3754a0a45fb421211ea9b815b4449999c66 (patch) | |
tree | eb19622d7c96c6f8d81a5095354d197fa6b20a52 /src/test/test_rebind.py | |
parent | 25f3b8244582c49db71c618c3859d7e7a89cd762 (diff) | |
download | tor-db9ab3754a0a45fb421211ea9b815b4449999c66.tar.gz tor-db9ab3754a0a45fb421211ea9b815b4449999c66.zip |
Print error message we get from socket.connect_ex when it fails
Diffstat (limited to 'src/test/test_rebind.py')
-rw-r--r-- | src/test/test_rebind.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/test_rebind.py b/src/test/test_rebind.py index 6f759b717e..7d0ccaf628 100644 --- a/src/test/test_rebind.py +++ b/src/test/test_rebind.py @@ -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): |