Skip to content

Commit

Permalink
Merge pull request #322 from forrejam/patch-1
Browse files Browse the repository at this point in the history
Check if stdout at EOF before read
  • Loading branch information
carlmontanari authored Apr 9, 2024
2 parents ac14468 + b725386 commit e0334ad
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 e0334ad

Please sign in to comment.