1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-02-07 05:30:44 +00:00

utils/serial_port: fix exception message

SerialError does not populate it's message attribute, so the message was
lost when re-raising as HostError. Pass the string representation of
SerialError into HostError instead.
This commit is contained in:
Sergei Trofimov 2018-03-02 15:54:48 +00:00 committed by Marc Bonnici
parent f490a55be2
commit c706e693ba

View File

@ -55,7 +55,7 @@ def get_connection(timeout, init_dtr=None, logcls=SerialLogger,
try:
conn = serial.Serial(*args, **kwargs)
except serial.SerialException as e:
raise HostError(e.message)
raise HostError(str(e))
if init_dtr is not None:
conn.setDTR(init_dtr)
conn.nonblocking()