set LD_LIBRARY_PATH for tor

This commit is contained in:
j 2016-02-01 00:03:53 +05:30
parent 24d4c4dc70
commit e0ba5ec2b2

View file

@ -71,10 +71,16 @@ DirReqStatistics 0
self.installing = False
tor = get_tor()
if tor:
if 'TorBrowser' in tor and sys.platform.startswith('linux'):
env = {
'LD_LIBRARY_PATH': os.path.dirname(tor)
}
else:
env = None
cmd = [tor, '--defaults-torrc', defaults, '-f', torrc]
while self.running:
self.p = subprocess.Popen(cmd, stdout=subprocess.PIPE, bufsize=1,
universal_newlines=True, start_new_session=True)
universal_newlines=True, start_new_session=True, env=env)
for line in self.p.stdout:
self._status.append(line)
logger.debug(line)