Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
pass
if self.process is None:
# the process has already been force killed and cleaned up by the
# `wait_for` above.
return self
self._kill_all_kids(sig)
exit_code = self.process.wait()
self._clear_process()
# Did the process shut down cleanly? A an exit code of `-sig` means
# that it has terminated due to signal `sig`, which is intended. So
# don't treat that as an error.
# pylint: disable=invalid-unary-operand-type
if exit_code and exit_code != -sig:
raise ProcessFinishedWithError(self, exit_code)
return self