summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian May <brian@linuxpenguins.xyz>2021-06-25 15:06:39 +1000
committerGitHub <noreply@github.com>2021-06-25 15:06:39 +1000
commitee02e1aaa20b03e565f4142b9e2598a6f893a8c4 (patch)
tree8c1ad4f85eecefc0ce7298e9c9153d7152e72558
parent78b80709f2f902d7866cc4fb9ff203a6d863457b (diff)
parentc06581cf83fdbf34269a3a3b42daa28b55ae4129 (diff)
Merge pull request #656 from kylekyle/master
replace psutil with os
-rwxr-xr-xsetup.py1
-rw-r--r--sshuttle/client.py5
2 files changed, 3 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index 735676c..54b751d 100755
--- a/setup.py
+++ b/setup.py
@@ -63,7 +63,6 @@ setup(
},
python_requires='>=3.6',
install_requires=[
- 'psutil',
],
tests_require=[
'pytest',
diff --git a/sshuttle/client.py b/sshuttle/client.py
index 349ad86..ef4f36b 100644
--- a/sshuttle/client.py
+++ b/sshuttle/client.py
@@ -6,7 +6,6 @@ import subprocess as ssubprocess
import os
import sys
import platform
-import psutil
import sshuttle.helpers as helpers
import sshuttle.ssnet as ssnet
@@ -650,7 +649,9 @@ def _main(tcp_listener, udp_listener, fw, ssh_cmd, remotename,
# poll() won't tell us when process exited since the
# process is no longer our child (it returns 0 all the
# time).
- if not psutil.pid_exists(serverproc.pid):
+ try:
+ os.kill(serverproc.pid, 0)
+ except OSError:
raise Fatal('ssh connection to server (pid %d) exited.' %
serverproc.pid)
else: