diff --git a/docs/changelog/3056.bugfix.rst b/docs/changelog/3056.bugfix.rst new file mode 100644 index 000000000..eccf816a8 --- /dev/null +++ b/docs/changelog/3056.bugfix.rst @@ -0,0 +1 @@ +Fix hang and zombie process on interrupt (CTRL-C). diff --git a/src/tox/execute/local_sub_process/__init__.py b/src/tox/execute/local_sub_process/__init__.py index 4332da9a3..2f9c7c8df 100644 --- a/src/tox/execute/local_sub_process/__init__.py +++ b/src/tox/execute/local_sub_process/__init__.py @@ -63,6 +63,8 @@ def __init__(self, options: ExecuteOptions, out: SyncWrite, err: SyncWrite, proc @property def exit_code(self) -> int | None: + # need to poll here, to make sure the returncode we get is current + self._process.poll() return self._process.returncode def interrupt(self) -> None: