mirror of
https://github.com/ARM-software/devlib.git
synced 2025-04-17 07:10:03 +01: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:
parent
f490a55be2
commit
c706e693ba
@ -55,7 +55,7 @@ def get_connection(timeout, init_dtr=None, logcls=SerialLogger,
|
|||||||
try:
|
try:
|
||||||
conn = serial.Serial(*args, **kwargs)
|
conn = serial.Serial(*args, **kwargs)
|
||||||
except serial.SerialException as e:
|
except serial.SerialException as e:
|
||||||
raise HostError(e.message)
|
raise HostError(str(e))
|
||||||
if init_dtr is not None:
|
if init_dtr is not None:
|
||||||
conn.setDTR(init_dtr)
|
conn.setDTR(init_dtr)
|
||||||
conn.nonblocking()
|
conn.nonblocking()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user