diff --git a/scripts/pylib/twister/twisterlib.py b/scripts/pylib/twister/twisterlib.py index b7672d4efc..5386c94f8f 100755 --- a/scripts/pylib/twister/twisterlib.py +++ b/scripts/pylib/twister/twisterlib.py @@ -718,9 +718,10 @@ class DeviceHandler(Handler): serial_line = ser.readline() except TypeError: pass + # ignore SerialException which may happen during the serial device + # power off/on process. except serial.SerialException: - ser.close() - break + pass # Just because ser_fileno has data doesn't mean an entire line # is available yet.