[tor-commits] [sbws/master] Move the exception where it actually would happen

pastly at torproject.org pastly at torproject.org
Wed Jul 11 15:05:40 UTC 2018


commit 03ba568621bcce04a4dce8156a9d26cf5090c654
Author: juga0 <juga at riseup.net>
Date:   Wed Jul 4 08:23:43 2018 +0000

    Move the exception where it actually would happen
---
 sbws/util/stem.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/sbws/util/stem.py b/sbws/util/stem.py
index 0c36d61..255ce22 100644
--- a/sbws/util/stem.py
+++ b/sbws/util/stem.py
@@ -192,14 +192,15 @@ def launch_tor(conf):
     # And return a controller to it
     cont = _init_controller_socket(conf['tor']['control_socket'])
     # Because we build things by hand and can't set these before Tor bootstraps
-    cont.set_conf('__DisablePredictedCircuits', '1')
-    cont.set_conf('__LeaveStreamsUnattached', '1')
     try:
-        log.info('Started and connected to Tor %s via %s', cont.get_version(),
-                 conf['tor']['control_socket'])
-        return cont
+        cont.set_conf('__DisablePredictedCircuits', '1')
+        cont.set_conf('__LeaveStreamsUnattached', '1')
     except Exception as e:
         log.exception("Exception trying to launch tor %s", e)
+        exit(1)
+    log.info('Started and connected to Tor %s via %s', cont.get_version(),
+             conf['tor']['control_socket'])
+    return cont
 
 
 def get_socks_info(controller):





More information about the tor-commits mailing list