From 3528d831f4cacffdf396697710013ba494eb76f8 Mon Sep 17 00:00:00 2001 From: mataotao Date: Wed, 26 Jun 2024 18:21:06 +0800 Subject: [PATCH] Added exception handling for OSError that may be thrown by os.read Signed-off-by: mataotao --- avocado/utils/process.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/avocado/utils/process.py b/avocado/utils/process.py index f0ef51ef23..b5288e2b87 100644 --- a/avocado/utils/process.py +++ b/avocado/utils/process.py @@ -485,7 +485,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)