diff --git a/docs/changelog.md b/docs/changelog.md index 55d0d42..625ee7a 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,14 @@ # Changelog +## `0.0.4` + +Released `2024-10-24` + +### Fixed + +- [#79](https://github.com/JoshKarpel/synthesize/pull/79) + Fix a crash that could happen when a process exits while we are trying to terminate it. + ## `0.0.3` Released `2024-07-07` diff --git a/synthesize/execution.py b/synthesize/execution.py index 3d34768..e990585 100644 --- a/synthesize/execution.py +++ b/synthesize/execution.py @@ -110,7 +110,11 @@ def _send_signal(self, signal: int) -> None: if self.has_exited: return None - os.killpg(os.getpgid(self.process.pid), signal) + try: + os.killpg(os.getpgid(self.process.pid), signal) + except ProcessLookupError: + # process exited before we could send the signal + pass def terminate(self) -> None: self._send_signal(SIGTERM)