Return whether process is alive
(self)
| 158 | _children.discard(self) |
| 159 | |
| 160 | def is_alive(self): |
| 161 | ''' |
| 162 | Return whether process is alive |
| 163 | ''' |
| 164 | self._check_closed() |
| 165 | if self is _current_process: |
| 166 | return True |
| 167 | assert self._parent_pid == os.getpid(), 'can only test a child process' |
| 168 | |
| 169 | if self._popen is None: |
| 170 | return False |
| 171 | |
| 172 | returncode = self._popen.poll() |
| 173 | if returncode is None: |
| 174 | return True |
| 175 | else: |
| 176 | _children.discard(self) |
| 177 | return False |
| 178 | |
| 179 | def close(self): |
| 180 | ''' |
no test coverage detected