Skip to content

Commit

Permalink
Merge pull request #5970 from faker-king/master
Browse files Browse the repository at this point in the history
Added exception handling for OSError that may be thrown by os.read
  • Loading branch information
richtja authored Jul 9, 2024
2 parents 232eefc + eb9b78e commit e236145
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 @@ -487,7 +487,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 e236145

Please sign in to comment.