px_uploader: fix SerialException error

Sometimes right after reboot, we got a `raise SerialException(
msg.errno, "could not open port {}: {}".format(self._port, msg))`.
If this happens now, we will just try again later.
This commit is contained in:
Julian Oes 2017-02-27 09:41:36 +01:00 committed by Beat Küng
parent b0a8073e15
commit 090d7ebd6b
1 changed files with 4 additions and 0 deletions

View File

@ -214,6 +214,10 @@ class uploader(object):
except OSError: except OSError:
# wait for the port to be ready # wait for the port to be ready
time.sleep(0.04) time.sleep(0.04)
except serial.SerialException:
# if open fails, try again later
time.sleep(0.04)
else: else:
break break