px_uploader: catch serial exception correctly

Signed-off-by: Julian Oes <julian@oes.ch>
This commit is contained in:
Julian Oes 2024-05-17 15:41:12 +12:00
parent e4fd80b6ef
commit 5bace785e0

View File

@ -914,7 +914,7 @@ def main():
print(f"Found board id: {up.board_type},{up.board_rev} bootloader protocol revision {up.bl_rev} on {port}")
break
except RuntimeError or serial.SerialException:
except (RuntimeError, serial.SerialException):
if not up.send_reboot(args.use_protocol_splitter_format):
break
@ -980,4 +980,4 @@ def main():
if __name__ == '__main__':
main()
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4