From 67a5696d042ceff5605abb991e80085cc386e2ca Mon Sep 17 00:00:00 2001 From: quettabit <27509167+quettabit@users.noreply.github.com> Date: Tue, 23 Jun 2026 15:15:08 -0700 Subject: [PATCH] initial commit --- examples/docs/encryption.py | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/examples/docs/encryption.py b/examples/docs/encryption.py index 7961c1d..33a950a 100644 --- a/examples/docs/encryption.py +++ b/examples/docs/encryption.py @@ -29,17 +29,11 @@ async def main(): raise RuntimeError("S2_ENCRYPTION_KEY is required") async with S2(access_token) as client: - basin = client.basin(basin_name) - stream_name = f"docs-encryption-{int(time.time())}" - # ANCHOR: basin-cipher - try: - await client.create_basin( - basin_name, - config=BasinConfig(stream_cipher=Encryption.AEGIS_256), - ) - except Exception: - pass + await client.create_basin( + basin_name, + config=BasinConfig(stream_cipher=Encryption.AEGIS_256), + ) await client.reconfigure_basin( basin_name, @@ -47,11 +41,10 @@ async def main(): ) # ANCHOR_END: basin-cipher - # Ensure stream exists - try: - await basin.create_stream(stream_name) - except Exception: - pass + basin = client.basin(basin_name) + stream_name = f"docs-encryption-{int(time.time())}" + + await basin.ensure_stream(stream_name) # ANCHOR: append-read stream = basin.stream(