[tor-commits] [sbws/master] Replace conf['tor']x by conf.getpath('tor', x)

pastly at torproject.org pastly at torproject.org
Thu Aug 9 14:21:20 UTC 2018


commit dd4629e270fd42d9e37652497aa857ccf5ceb6de
Author: juga0 <juga at riseup.net>
Date:   Tue Jul 24 17:37:19 2018 +0000

    Replace conf['tor']x by conf.getpath('tor', x)
---
 sbws/util/stem.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sbws/util/stem.py b/sbws/util/stem.py
index 32c9b8c..566261b 100644
--- a/sbws/util/stem.py
+++ b/sbws/util/stem.py
@@ -119,7 +119,7 @@ def _init_controller_socket(socket):
 
 def launch_tor(conf):
     assert isinstance(conf, ConfigParser)
-    os.makedirs(conf['tor']['datadir'], mode=0o700, exist_ok=True)
+    os.makedirs(conf.getpath('tor', 'datadir'), mode=0o700, exist_ok=True)
     # Bare minimum things, more or less
     torrc = copy.deepcopy(TORRC_STARTING_POINT)
     # Very important and/or common settings that we don't know until runtime
@@ -190,7 +190,7 @@ def launch_tor(conf):
     except Exception as e:
         fail_hard('Error trying to launch tor: %s', e)
     # And return a controller to it
-    cont = _init_controller_socket(conf['tor']['control_socket'])
+    cont = _init_controller_socket(conf.getpath('tor', 'control_socket'))
     # Because we build things by hand and can't set these before Tor bootstraps
     try:
         cont.set_conf('__DisablePredictedCircuits', '1')
@@ -201,7 +201,7 @@ def launch_tor(conf):
                       "sbws instance?", e)
         exit(1)
     log.info('Started and connected to Tor %s via %s', cont.get_version(),
-             conf['tor']['control_socket'])
+             conf.getpath('tor', 'control_socket'))
     return cont
 
 





More information about the tor-commits mailing list