Fixed issues

This commit is contained in:
2025-02-21 14:54:20 +01:00
parent 7ce84f5637
commit cc34f33d92
2 changed files with 11 additions and 2 deletions

View File

@ -73,12 +73,17 @@ def main():
exit(1)
try:
exec(f"from remotesyn.toolchains.{toolchain} import do")
print(f'Importing toolchain {toolchain}')
namespace = {}
exec(f"from remotesyn.toolchains.{toolchain} import do", globals(), namespace)
do_func = namespace.get('do')
if do_func is None:
raise ImportError("Failed to import 'do'")
except ImportError:
log(f"ERROR: Unknown toolchain '{toolchain}'")
exit(1)
ret = do(config, target, log, subprocesses)
ret = do_func(config, target, log, subprocesses)
if ret!=0:
log("ERROR: toolchain returned with", ret)