From e7839f1cb6a617e4fa4074a50954897c1bec645e Mon Sep 17 00:00:00 2001 From: daid Date: Fri, 2 Feb 2018 09:11:24 +0100 Subject: [PATCH] Prevent detect_targets.py tool script from crashing on known targets As mut['mcu'] can be "None" on unknown targets, the detect_targets script crashes when one of these boards is connected. This happens when "mbed-cli detect -vv" is ran when a STEVAL-3DP001V1 board is connected. Which does not provide a html file with a target_id, and thus cannot be looked up in the mbedls platform database. http://www.st.com/en/evaluation-tools/steval-3dp001v1.html --- tools/detect_targets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/detect_targets.py b/tools/detect_targets.py index b6407ae93a..eef1a2dc33 100644 --- a/tools/detect_targets.py +++ b/tools/detect_targets.py @@ -79,7 +79,7 @@ def main(): count = 0 for mut in muts.values(): - if re.match(mcu_filter, mut['mcu']): + if re.match(mcu_filter, mut['mcu'] or "Unknown"): interface_version = get_interface_version(mut['disk']) print "" print "[mbed] Detected %s, port %s, mounted %s, interface version %s:" % \