Skip to content

Commit 12d3f8f

Browse files
sicoyleCopilotCasperGNacroca
authored
style: rm warning for python 3.14 (#1072)
* style: rm warning for python 3.14 Signed-off-by: Samantha Coyle <sam@diagrid.io> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Sam <sam@diagrid.io> --------- Signed-off-by: Samantha Coyle <sam@diagrid.io> Signed-off-by: Sam <sam@diagrid.io> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Casper Nielsen <casper@diagrid.io> Co-authored-by: Albert Callarisa <albert@diagrid.io>
1 parent 5f3d4fd commit 12d3f8f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask

ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask/client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,11 @@ def __enter__(self):
175175
return self
176176

177177
def __exit__(self, exc_type, exc, tb):
178-
try:
179-
self.close()
180-
finally:
181-
return False
178+
# close() is best-effort and swallows its own errors, so a plain call is safe here.
179+
# Returning False (i.e., not suppressing the original exception) is the same behavior
180+
# as the previous try/finally, without the `return in finally` SyntaxWarning on Python 3.14+.
181+
self.close()
182+
return False
182183

183184
def close(self) -> None:
184185
"""Close the underlying gRPC channel."""

0 commit comments

Comments
 (0)