Refactor condition check

pull/12198/head
Rajkumar Kanagaraj 2020-01-15 09:47:59 -08:00
parent 816516e23c
commit f5230cd70c
1 changed files with 4 additions and 7 deletions

View File

@ -233,7 +233,7 @@ def find_valid_toolchain(target, toolchain):
toolchain_names = get_valid_toolchain_names(target, toolchain)
last_error = None
for index, toolchain_name in enumerate(toolchain_names):
internal_tc_name = get_toolchain_name(target, toolchain_name)
internal_tc_name = get_toolchain_name(target, toolchain_name)
if not TOOLCHAIN_CLASSES[internal_tc_name].check_executable():
search_path = TOOLCHAIN_PATHS[internal_tc_name] or "No path set"
last_error = (
@ -243,12 +243,9 @@ def find_valid_toolchain(target, toolchain):
else:
if toolchain_name in ["uARM", "ARMC5", "ARMC6"]:
if toolchain_name == "ARMC5":
end_warnings.append(ARMC5_MIGRATION_WARNING)
if (
toolchain_name == "uARM"
or target.default_toolchain == "uARM"
):
end_warnings.append(UARM_TOOLCHAIN_WARNING)
end_warnings.append(ARMC5_MIGRATION_WARNING)
if "uARM" in {toolchain_name, target.default_toolchain}:
end_warnings.append(UARM_TOOLCHAIN_WARNING)
return toolchain_name, internal_tc_name, end_warnings
else:
if last_error: