def kill(self, pid):
        """Kills a process that was started by spawn."""
        logging.msg("kill", str(pid))
        try:
            sts = self._status.pop(pid)
        except __HOLE__:
            return -errno.ENOENT
        else:
            if sts is None: # a running process
                pm = proctools.get_procmanager()
                proc = pm.getbypid(pid)
                proc.kill()
                proc.wait()
                sts = self.poll(pid)
                return sts
            else: # already exited
                return sts
dataset/ETHPy150Open kdart/pycopia/QA/pycopia/remote/PosixServer.py/PosixAgent.kill