(self)
| 1418 | return self.process.returncode |
| 1419 | |
| 1420 | def stop(self) -> None: |
| 1421 | super().stop() |
| 1422 | # If we opened a PTY for child communications, make sure to close() it, |
| 1423 | # otherwise long-running Invoke-using processes exhaust their file |
| 1424 | # descriptors eventually. |
| 1425 | if self.using_pty: |
| 1426 | try: |
| 1427 | os.close(self.parent_fd) |
| 1428 | except Exception: |
| 1429 | # If something weird happened preventing the close, there's |
| 1430 | # nothing to be done about it now... |
| 1431 | pass |
| 1432 | |
| 1433 | |
| 1434 | class Result: |