Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Raise proper timeout exception

Tomas Valenta8a993ce7ebef
diff --git a/packages/python-sdk/e2b/sandbox/process.py b/packages/python-sdk/e2b/sandbox/process.py
index 5281e5482..043493833 100644
--- a/packages/python-sdk/e2b/sandbox/process.py
+++ b/packages/python-sdk/e2b/sandbox/process.py
@@ -24,6 +24,7 @@ from e2b.sandbox.exception import (
ProcessException,
RpcException,
CurrentWorkingDirectoryDoesntExistException,
+ TimeoutException,
)
from e2b.sandbox.out import OutStderrResponse, OutStdoutResponse
from e2b.sandbox.sandbox_connection import SandboxConnection, SubscriptionArgs
@@ -180,6 +181,8 @@ class Process:
if not self._sandbox.is_open:
break
+ raise TimeoutException(f"Process did not finish within {timeout} seconds")
+
def send_stdin(self, data: str, timeout: Optional[float] = TIMEOUT) -> None:
"""
Send data to the process stdin.