diff --git a/.changeset/breezy-seals-play.md b/.changeset/breezy-seals-play.md new file mode 100644 index 0000000000..d00edcfdc0 --- /dev/null +++ b/.changeset/breezy-seals-play.md @@ -0,0 +1,5 @@ +--- +'@e2b/cli': patch +--- + +Update text in toml for sync Python diff --git a/packages/cli/src/commands/template/build.ts b/packages/cli/src/commands/template/build.ts index c61909facc..ec9215e3f2 100644 --- a/packages/cli/src/commands/template/build.ts +++ b/packages/cli/src/commands/template/build.ts @@ -472,7 +472,7 @@ async function waitForBuildFinish( const pythonExample = asPython(`from e2b import Sandbox, AsyncSandbox # Create sync sandbox -sandbox = Sandbox("${aliases?.length ? aliases[0] : template.templateID}") +sandbox = Sandbox.create("${aliases?.length ? aliases[0] : template.templateID}") # Create async sandbox sandbox = await AsyncSandbox.create("${ diff --git a/packages/cli/src/config/index.ts b/packages/cli/src/config/index.ts index 7ccda48f0d..5f2587b74e 100644 --- a/packages/cli/src/config/index.ts +++ b/packages/cli/src/config/index.ts @@ -15,7 +15,7 @@ function getConfigHeader(config: E2BConfig) { # Python SDK # from e2b import Sandbox, AsyncSandbox -# sandbox = Sandbox("${config.template_name || config.template_id}") # Sync sandbox +# sandbox = Sandbox.create("${config.template_name || config.template_id}") # Sync sandbox # sandbox = await AsyncSandbox.create("${config.template_name || config.template_id}") # Async sandbox # JS SDK diff --git a/packages/python-sdk/tests/async/sandbox_async/test_snapshot.py b/packages/python-sdk/tests/async/sandbox_async/test_snapshot.py index 3db48afd70..d5b7bce4ee 100644 --- a/packages/python-sdk/tests/async/sandbox_async/test_snapshot.py +++ b/packages/python-sdk/tests/async/sandbox_async/test_snapshot.py @@ -11,5 +11,5 @@ async def test_snapshot(async_sandbox: AsyncSandbox): resumed_sandbox = await async_sandbox.connect() assert await async_sandbox.is_running() - assert resumed_sandbox.is_running() + assert await resumed_sandbox.is_running() assert resumed_sandbox.sandbox_id == async_sandbox.sandbox_id