def get_toolchain(tc_name): """ Get an existing tolchain using its name """ tc_names = get_tc_names() if not tc_name in tc_names: mess = "No such toolchain: %s\n" % tc_name mess += "Known toolchains are:\n" for name in tc_names: mess += " * " + name + "\n" raise Exception(mess) return Toolchain(tc_name)