Skip to content

Commit 7923c27

Browse files
committed
Fix unit test failure on Windows when calling abort on a transport
1 parent cb87de9 commit 7923c27

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

asyncssh/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ def _force_close(self, exc: Optional[Exception]) -> None:
10781078
if not self._transport:
10791079
return
10801080

1081-
self._transport.abort()
1081+
self._loop.call_soon(self._transport.abort)
10821082
self._transport = None
10831083

10841084
self._loop.call_soon(self._cleanup, exc)
@@ -1413,7 +1413,7 @@ def _send(self, data: bytes) -> None:
14131413
if self._transport:
14141414
try:
14151415
self._transport.write(data)
1416-
except BrokenPipeError: # pragma: no cover
1416+
except ConnectionError: # pragma: no cover
14171417
pass
14181418

14191419
def _send_version(self) -> None:

0 commit comments

Comments
 (0)