From bc31e6317d0443ffc891fbff01462d27be1439e2 Mon Sep 17 00:00:00 2001 From: Luke Parke <5702154+LukasParke@users.noreply.github.com> Date: Wed, 21 Oct 2026 18:43:04 +0000 Subject: [PATCH] fix(python): make the resource management README snippet valid Python The Resource Management README section rendered `with` and `async with` blocks whose bodies contained only a comment, so copying the snippet raised an IndentationError. Add a `pass` statement after the placeholder comment in both async modes. --- .changesets/1792607797-a1ef7f0c.yaml | 10 ++++++++++ .../pythonv2/readme/resource-management.stmpl | 4 ++++ zSDKs/sdk-pythonv2/README.md | 2 ++ 3 files changed, 16 insertions(+) create mode 100644 .changesets/1792607797-a1ef7f0c.yaml diff --git a/.changesets/1792607797-a1ef7f0c.yaml b/.changesets/1792607797-a1ef7f0c.yaml new file mode 100644 index 000000000..b75464e56 --- /dev/null +++ b/.changesets/1792607797-a1ef7f0c.yaml @@ -0,0 +1,10 @@ +id: 1792607797-a1ef7f0c +features: + - docs +targets: + - pythonv2 +type: fix +bump: patch +description: make the Resource Management README snippet valid Python +author: LukasParke +date: "2026-10-21" diff --git a/templates/templates/pythonv2/readme/resource-management.stmpl b/templates/templates/pythonv2/readme/resource-management.stmpl index 4f08ca004..8470c49ab 100644 --- a/templates/templates/pythonv2/readme/resource-management.stmpl +++ b/templates/templates/pythonv2/readme/resource-management.stmpl @@ -16,12 +16,14 @@ The `{{$sdkClassName}}` class implements the context manager protocol and regist def main(): {{templateString "usage/init.stmpl" $syncCallContext | indentPresent 4}} # Rest of application here... + pass # Or when using async: async def amain(): {{templateString "usage/init.stmpl" $asyncCallContext | indentPresent 4}} # Rest of application here... + pass ``` {{- end }} {{- else if eq .Global.Config.AsyncMode "split"}} @@ -41,12 +43,14 @@ The `{{$sdkClassName}}` and `Async{{$sdkClassName}}` classes implement the conte def main(): {{templateString "usage/init.stmpl" $syncCallContext | indentPresent 4}} # Rest of application here... + pass # Or when using async: async def amain(): {{templateString "usage/init.stmpl" $asyncCallContext | indentPresent 4}} # Rest of application here... + pass ``` {{- end }} {{- end }} \ No newline at end of file diff --git a/zSDKs/sdk-pythonv2/README.md b/zSDKs/sdk-pythonv2/README.md index bcd169251..ab092adf1 100644 --- a/zSDKs/sdk-pythonv2/README.md +++ b/zSDKs/sdk-pythonv2/README.md @@ -1751,6 +1751,7 @@ def main(): with SDK() as sdk: # Rest of application here... + pass # Or when using async: @@ -1758,6 +1759,7 @@ async def amain(): async with AsyncSDK() as sdk: # Rest of application here... + pass ```