Skip to content

Commit

Permalink
Check if stdout at EOF before read
Browse files Browse the repository at this point in the history
fixes #321
  • Loading branch information
forrejam authored Apr 9, 2024
1 parent ac14468 commit b725386
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scrapli/transport/plugins/asyncssh/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ async def read(self) -> bytes:
if not self.stdout:
raise ScrapliConnectionNotOpened

if self.stdout.at_eof():
raise ScrapliConnectionError("transport at EOF; no more data to be read")

try:
buf: bytes = await self.stdout.read(65535)
except ConnectionLost as exc:
Expand Down

0 comments on commit b725386

Please sign in to comment.