Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Switch order or exit handlers so it is consistent with JS SDK and terminal exit handlers

Tomas Valenta325a009b43a3
diff --git a/packages/python-sdk/e2b/session/process.py b/packages/python-sdk/e2b/session/process.py
index 28d7bc26b..36857f334 100644
--- a/packages/python-sdk/e2b/session/process.py
+++ b/packages/python-sdk/e2b/session/process.py
@@ -274,9 +274,9 @@ class ProcessManager:
)
if unsub_all:
await unsub_all()
- future_exit_handler_finish(output)
if on_exit:
on_exit()
+ future_exit_handler_finish(output)
exit_task = asyncio.create_task(exit_handler())
self._process_cleanup.append(exit_task.cancel)