Close the Process object. This method releases resources held by the Process object. It is an error to call this method if the child process is still running.
(self)
| 170 | return False |
| 171 | |
| 172 | def close(self): |
| 173 | ''' |
| 174 | Close the Process object. |
| 175 | |
| 176 | This method releases resources held by the Process object. It is |
| 177 | an error to call this method if the child process is still running. |
| 178 | ''' |
| 179 | if self._popen is not None: |
| 180 | if self._popen.poll() is None: |
| 181 | raise ValueError("Cannot close a process while it is still running. " |
| 182 | "You should first call join() or terminate().") |
| 183 | self._popen.close() |
| 184 | self._popen = None |
| 185 | del self._sentinel |
| 186 | _children.discard(self) |
| 187 | self._closed = True |
| 188 | |
| 189 | @property |
| 190 | def name(self): |