pimlico.utils.communicate module¶
-
timeout_process
(*args, **kwds)[source]¶ Context manager for use in a with statement. If the with block hasn’t completed after the given number of seconds, the process is killed.
Parameters: proc – process to kill if timeout is reached before end of block Returns:
-
terminate_process
(proc, kill_time=None)[source]¶ Ends a process started with subprocess. Tries killing, then falls back on terminating if it doesn’t work.
Parameters: - kill_time – time to allow the process to be killed before falling back on terminating
- proc – Popen instance
Returns: