From b85d8e0211502560bf34f130e75c037cb19b5574 Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Fri, 16 Sep 2016 14:29:08 -0500 Subject: [PATCH] Fix mbed-ls on OSX machines On OSX mbed-ls can return null for some endpoints at times. This patch updates the code to gracefully handle this. --- test/daplink_board.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/daplink_board.py b/test/daplink_board.py index 111693e89..07a6e8d4f 100644 --- a/test/daplink_board.py +++ b/test/daplink_board.py @@ -528,8 +528,14 @@ def _update_board_info(self, exptn_on_fail=True): return False self.unique_id, self.serial_port, self.mount_point = endpoints # Serial port can be missing - assert self.unique_id is not None - assert self.mount_point is not None + if self.unique_id is None: + if exptn_on_fail: + raise Exception("Mount point is null") + return False + if self.mount_point is None: + if exptn_on_fail: + raise Exception("Mount point is null") + return False self.board_id = int(self.unique_id[0:4], 16) self._hic_id = int(self.unique_id[-8:], 16)