[tor-commits] [ooni-probe/master] Expand the user (~) fragment when creating directory
art at torproject.org
art at torproject.org
Tue Jan 8 20:11:40 UTC 2013
commit 09c94c9f578cf2edd8f22694aebeb8ae0e45d89c
Author: Arturo Filastò <art at fuffa.org>
Date: Tue Jan 8 21:11:20 2013 +0100
Expand the user (~) fragment when creating directory
---
ooni/runner.py | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/ooni/runner.py b/ooni/runner.py
index 1a7e629..19d7e1f 100644
--- a/ooni/runner.py
+++ b/ooni/runner.py
@@ -529,10 +529,12 @@ def startTor():
config.tor.socks_port = socks_port
if config.tor.data_dir:
- if not os.path.exists(config.tor.data_dir):
- log.msg("%s does not exist. Creating it." % config.tor.data_dir)
- os.makedirs(config.tor.data_dir)
- tor_config.DataDirectory = os.path.expanduser(config.tor.data_dir)
+ data_dir = os.path.expanduser(config.tor.data_dir)
+
+ if not os.path.exists(data_dir):
+ log.msg("%s does not exist. Creating it." % data_dir)
+ os.makedirs(data_dir)
+ tor_config.DataDirectory = data_dir
tor_config.save()
More information about the tor-commits
mailing list