use local tor if no registed version can be found
This commit is contained in:
parent
9fcd9491ac
commit
021c418622
2 changed files with 9 additions and 3 deletions
|
|
@ -215,7 +215,7 @@ def get_tor():
|
|||
if sys.platform == 'darwin':
|
||||
for path in (
|
||||
'/Applications/TorBrowser.app/TorBrowser/Tor/tor',
|
||||
os.path.join(settings.base_dir, 'tor', 'TorBrowser.app/TorBrowser/Tor/tor')
|
||||
os.path.join(settings.base_dir, 'tor', 'TorBrowser.app', 'TorBrowser', 'Tor', 'tor')
|
||||
):
|
||||
if os.path.isfile(path) and os.access(path, os.X_OK):
|
||||
return path
|
||||
|
|
@ -231,6 +231,10 @@ def get_tor():
|
|||
return path
|
||||
except:
|
||||
pass
|
||||
local_tor = os.path.normpath(os.path.join(settings.base_dir, '..',
|
||||
'tor', 'tor-browser_en-US', 'Browser', 'TorBrowser', 'Tor', 'tor'))
|
||||
if os.path.exists(local_tor):
|
||||
return local_tor
|
||||
return distutils.spawn.find_executable('tor')
|
||||
|
||||
def install_tor():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue