def reapProcess(self):
        try:
            try:
                pid, status = os.waitpid(self.pid, os.WNOHANG)
            except OSError, e:
                if e.errno == errno.ECHILD:
                    # no child process
                    pid = None
                else:
                    raise
        except:
            log.msg('Failed to reap %d:' % self.pid)
            log.err()
            pid = None
        if pid:
            self.processEnded(status)
            unregisterReapProcessHandler(pid, self)
Try to reap a process (without blocking) via waitpid.
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/internet/process.py/_BaseProcess.reapProcess