refactor: Raise ImportError with module name in PythonREPLTool

This commit is contained in:
ogabrielluiz 2024-06-17 12:10:40 -03:00
commit 91474ab6ca

View file

@ -36,7 +36,7 @@ class PythonREPLToolComponent(CustomComponent):
imported_module = importlib.import_module(module)
global_dict[imported_module.__name__] = imported_module
except ImportError:
print(f"Could not import module {module}")
raise ImportError(f"Could not import module {module}")
return global_dict
def build(