Skip to content

Commit bfa04aa

Browse files
committed
Avoid error on process wait() followed by wait_closed()
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!
1 parent 25cb98f commit bfa04aa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

asyncssh/process.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,8 @@ async def wait_closed(self) -> None:
12101210
for task in self._cleanup_tasks:
12111211
await task
12121212

1213+
self._cleanup_tasks = []
1214+
12131215

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

0 commit comments

Comments
 (0)