diff --git a/src/smolagents/local_python_executor.py b/src/smolagents/local_python_executor.py index 346f0fe..85b5317 100644 --- a/src/smolagents/local_python_executor.py +++ b/src/smolagents/local_python_executor.py @@ -1067,7 +1067,9 @@ def import_modules(expression, state, authorized_imports): else: raise InterpreterError(f"Module {expression.module} has no attribute {alias.name}") else: - raise InterpreterError(f"Import from {expression.module} is not allowed.") + raise InterpreterError( + f"Import from {expression.module} is not allowed. Authorized imports are: {str(authorized_imports)}" + ) return None