Skip to content

Commit

Permalink
Fix hang and zombie process on interrupt (CTRL-C). (#3057)
Browse files Browse the repository at this point in the history
  • Loading branch information
sk1p committed Jul 6, 2023
1 parent 55c143f commit dea2d00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changelog/3056.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix hang and zombie process on interrupt (CTRL-C).
2 changes: 2 additions & 0 deletions src/tox/execute/local_sub_process/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit dea2d00

Please sign in to comment.