From c06581cf83fdbf34269a3a3b42daa28b55ae4129 Mon Sep 17 00:00:00 2001 From: Kyle Date: Wed, 23 Jun 2021 21:53:03 -0400 Subject: replace psutil with os --- sshuttle/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sshuttle/client.py') 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: -- cgit v1.2.3