'poll(block = False) -> int
Arguments:
block(bool): Wait for the process to exit
Poll the exit code of the process. Will return None, if the
process has not yet finished and the exit code otherwise.'

def poll(self, block=False):

    _ = self.cwd
    if block:
        self.wait_for_close()
    self.proc.poll()
    returncode = self.proc.returncode
    if ((returncode != None) and (not self._stop_noticed)):
        self._stop_noticed = time.time()
        signame = ''
        if (returncode < 0):
            signame = ('    (%s)' % signal_names.get(returncode, 'SIG???'))
        self.info(('Process    %r    stopped    with    exit    code    %d%s    (pid    %i)' % (self.display, returncode, signame, self.pid)))
    return returncode
