Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Don't set result if already set
Jakub Novak74d2dc4dbc24
diff --git a/packages/python-sdk/e2b/sandbox/process.py b/packages/python-sdk/e2b/sandbox/process.pyindex c8be37902..5281e5482 100644--- a/packages/python-sdk/e2b/sandbox/process.py+++ b/packages/python-sdk/e2b/sandbox/process.py@@ -262,7 +262,8 @@ class ProcessManager:def handle_exit(exit_code: int):output.exit_code = exit_codelogger.info(f"Process {process_id} exited with exit code {exit_code}")- future_exit.set_result(True)+ if not future_exit.done():+ future_exit.set_result(True)def handle_stdout(data: Dict[Any, Any]):out = OutStdoutResponse(**data)@@ -354,7 +355,9 @@ class ProcessManager:def trigger_exit():logger.info(f"Exiting the process (id: {process_id})")- future_exit.set_result(None)+ if not future_exit.done():+ future_exit.set_result(None)+future_exit_handler_finish.result()logger.debug(f"Exited the process (id: {process_id})")