Skip to content
Snippets Groups Projects
Commit 98413e43 authored by Alexandre Abadie's avatar Alexandre Abadie
Browse files

tools/pyterm: catch serial.Exception when port is busy

This can happen when opening a terminal right after flashing a board that has just been plugged
parent 310ef3c2
No related branches found
No related tags found
No related merge requests found
...@@ -247,6 +247,9 @@ class SerCmd(cmd.Cmd): ...@@ -247,6 +247,9 @@ class SerCmd(cmd.Cmd):
self.logger.error("Cannot connect to serial port {}: {}" self.logger.error("Cannot connect to serial port {}: {}"
.format(self.port, e.strerror)) .format(self.port, e.strerror))
sys.exit(1) sys.exit(1)
except serial.SerialException as e:
self.logger.error("%s", e.strerror)
sys.exit(1)
# wait until connection is established and fire startup # wait until connection is established and fire startup
# commands to the node # commands to the node
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment