diff --git a/torpinger b/torpinger index 16299d3..e8ab37d 100755 --- a/torpinger +++ b/torpinger @@ -74,7 +74,8 @@ class TorPinger(object): print(resp.read()) resp.close() except OSError as e: - print('Time out',e) + print('Error:', e) + sys.exit(1) def which_socks(self): op = subprocess.check_output('netstat -lnt',shell=True).decode() @@ -96,8 +97,8 @@ class TorPinger(object): time.sleep(self.timeout_one_check) ## If we get away from loop due to timeout, then exit if len(SOCKS) == 0: - print('Sorry dude couldn\'t find any active tor connection in the\ - given time, exitting') + print('Sorry dude - couldn\'t find any active Tor connection in the' + ' given time, exiting.') return ## Else we are good to go and have a list of open tor sockets ## Of which we choose the one with highest priority