'UNIX: make sure subprocess is terminated and collect status'

def unix_terminate(self):

    if hasattr(os, 'kill'):
        try:
            os.kill(self.rpcpid, SIGTERM)
        except OSError:
            return
        try:
            os.waitpid(self.rpcpid, 0)
        except OSError:
            return
