diff options
author | Micah Lee <micah@micahflee.com> | 2020-11-17 18:46:22 -0800 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2020-11-17 18:46:22 -0800 |
commit | 65dff09a6891170ba4d26987a4d705ca8affc99f (patch) | |
tree | 90c4365033105be2f6215ecd29be426096c1ff7f /cli | |
parent | 4085814a3358ccc40661b488eb597ac6d8e4bfab (diff) | |
download | onionshare-65dff09a6891170ba4d26987a4d705ca8affc99f.tar.gz onionshare-65dff09a6891170ba4d26987a4d705ca8affc99f.zip |
Make onionshare tor process detection work in Windows
Diffstat (limited to 'cli')
-rw-r--r-- | cli/onionshare_cli/onion.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/onionshare_cli/onion.py b/cli/onionshare_cli/onion.py index 138a6673..1b025bf8 100644 --- a/cli/onionshare_cli/onion.py +++ b/cli/onionshare_cli/onion.py @@ -238,7 +238,7 @@ class Onion(object): # If there is an existing OnionShare tor process, kill it for proc in psutil.process_iter(["pid", "name", "username"]): - if proc.username() == getpass.getuser(): + try: cmdline = proc.cmdline() if ( cmdline[0] == self.tor_path @@ -252,6 +252,9 @@ class Onion(object): ) proc.terminate() proc.wait() + break + except: + pass if self.common.platform == "Windows" or self.common.platform == "Darwin": # Windows doesn't support unix sockets, so it must use a network port. |