Skip to content

Commit

Permalink
Avoid error on process wait() followed by wait_closed()
Browse files Browse the repository at this point in the history
This commit prevents a RuntimeException from occurring when a process
has wait() called on it and later a call is made to wait_closed() (such
as from a context manager). Thanks go to GitHub user starflows for
reporting this issue!
  • Loading branch information
ronf committed Oct 19, 2024
1 parent 25cb98f commit bfa04aa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions asyncssh/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,8 @@ async def wait_closed(self) -> None:
for task in self._cleanup_tasks:
await task

self._cleanup_tasks = []


class SSHClientProcess(SSHProcess[AnyStr], SSHClientStreamSession[AnyStr]):
"""SSH client process handler"""
Expand Down

0 comments on commit bfa04aa

Please sign in to comment.