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
pull/6000/head
daid 2018-02-02 09:11:24 +01:00 committed by GitHub
parent b8d218038b
commit e7839f1cb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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:" % \