diff --git a/src/vpn_manager_globalprotect/backend.py b/src/vpn_manager_globalprotect/backend.py index b5da280..17cb137 100644 --- a/src/vpn_manager_globalprotect/backend.py +++ b/src/vpn_manager_globalprotect/backend.py @@ -358,14 +358,17 @@ class GlobalProtectConnection( if self._wait_task is not None: self._wait_task.cancel() self._disconnecting = True - self._proc.terminate() + try: + self._proc.terminate() + except: + # Process doesn't exist, we are in the state we want so... :shrug: this is fine + return # If the process takes longer than 10 seconds to exit, kill it sith WIGKILL try: async with timeout(10): await self._proc_wait_task except TimeoutError: self._proc.kill() - await self._proc_wait_task async def temporary_disconnect(self): f"""{super().temporary_disconnect.__doc__}"""