Skip to content

Commit

Permalink
Added exception handling for OSError that may be thrown by os.read
Browse files Browse the repository at this point in the history
Signed-off-by: mataotao <[email protected]>
  • Loading branch information
mataotao authored and smitterl committed Sep 3, 2024
1 parent 18bebb9 commit 52d69be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion avocado/utils/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,10 @@ def _drainer(self):
if not has_io:
# Don't read unless there are new data available
continue
tmp = os.read(self.fd, 8192)
try:
tmp = os.read(self.fd, 8192)
except OSError:
break
if not tmp:
break
self.data.write(tmp)
Expand Down

0 comments on commit 52d69be

Please sign in to comment.