mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-04 07:25:10 -04:00
Make onionshare tor process detection work in Windows
This commit is contained in:
parent
e2709c1d19
commit
717c8ec2f3
1 changed files with 4 additions and 1 deletions
|
@ -238,7 +238,7 @@ class Onion(object):
|
||||||
|
|
||||||
# If there is an existing OnionShare tor process, kill it
|
# If there is an existing OnionShare tor process, kill it
|
||||||
for proc in psutil.process_iter(["pid", "name", "username"]):
|
for proc in psutil.process_iter(["pid", "name", "username"]):
|
||||||
if proc.username() == getpass.getuser():
|
try:
|
||||||
cmdline = proc.cmdline()
|
cmdline = proc.cmdline()
|
||||||
if (
|
if (
|
||||||
cmdline[0] == self.tor_path
|
cmdline[0] == self.tor_path
|
||||||
|
@ -252,6 +252,9 @@ class Onion(object):
|
||||||
)
|
)
|
||||||
proc.terminate()
|
proc.terminate()
|
||||||
proc.wait()
|
proc.wait()
|
||||||
|
break
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
if self.common.platform == "Windows" or self.common.platform == "Darwin":
|
if self.common.platform == "Windows" or self.common.platform == "Darwin":
|
||||||
# Windows doesn't support unix sockets, so it must use a network port.
|
# Windows doesn't support unix sockets, so it must use a network port.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue