1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 22:13:52 +01:00

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
This commit is contained in:
Alexandre Abadie 2018-11-27 16:46:45 +01:00
parent 310ef3c29e
commit 98413e43af

View File

@ -247,6 +247,9 @@ class SerCmd(cmd.Cmd):
self.logger.error("Cannot connect to serial port {}: {}"
.format(self.port, e.strerror))
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
# commands to the node