Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions invoke/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,11 @@ def returncode(self) -> Optional[int]:
return self.process.returncode

def stop(self) -> None:
for fd in ['stdout', 'stderr', 'stdin']:
try:
getattr(self.process, fd).close()
except:
pass # We tried 🤷
# If we opened a PTY for child communications, make sure to close() it,
# otherwise long-running Invoke-using processes exhaust their file
# descriptors eventually.
Expand Down